Skip to content

Conversation

@WesleyRosenblum
Copy link
Contributor

@WesleyRosenblum WesleyRosenblum commented Aug 11, 2023

Description of changes:

The count of currently handshaking connections in the connection container was not being decremented when a connnection moved from handshaking directly to finalizing. This change corrects this behavior.

Call-outs:

There is a brief moment between when update_interests() is called and finalize_done_connections() is called when the handshake_connections count is technically incorrect. This is because I decided to account for both handshaking connections and handshaking completed connections in the update_interests() method so I would not need to lock the connection multiple times. A connection that is handshaking and finalizing will decrement the handshake_connections count, but is not be removed from the connection map until finalize_done_connections is called. This meant I had to call finalize_done_connections() prior to ensure_counter_consistency(). I added some debug assertions in finalize_done_connections() to ensure the accounting is still correct.

Testing:

Updated the connection container fuzz test to trigger this scenario

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@WesleyRosenblum WesleyRosenblum merged commit c7e3f51 into main Aug 14, 2023
@WesleyRosenblum WesleyRosenblum deleted the WesleyRosenblum/handshakecount branch August 14, 2023 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants