tcp: free up unsuccessful connection attempts#165
Merged
rcschrg merged 1 commit intodevelopmentfrom Apr 8, 2025
Merged
Conversation
… count if a connection attempt throws an error in `create_connection`, we do not decrease the counter in _connection_counts. Therefore, maximum 10 connection attempts are made if the other container is not ready yet This is fixed by decreasing if an error is thrown during create_connection
d0e2527 to
6326813
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## development #165 +/- ##
===============================================
- Coverage 89.23% 89.13% -0.10%
===============================================
Files 22 22
Lines 2507 2512 +5
===============================================
+ Hits 2237 2239 +2
- Misses 270 273 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
rcschrg
approved these changes
Apr 8, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
unsuccessful connection attempts are never freed from connection count
if a connection attempt throws an error in
create_connection, we do not decrease the counter in _connection_counts, as the list stays empty. Therefore, maximum 10 connection attempts are made if the other container is not ready yet.This was the case when using the
wait_all_onlinefrom theDistributedClockManager.The manager did send 10 requests to check if all respond, but stops afterwards, as all connection_counts are allocated.
This is fixed by defering the increment of the connection count right after we successfully created a connection.A similar solution would be to decrease it again on failure, which would decrease the probability of creating too many connections, while the last connection is created - though I would go for less lines of code on this one.Fix this by decrementing the counter if an error is thrown