-
Notifications
You must be signed in to change notification settings - Fork 725
Updated Connections handling #1127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
- The ConnectionPool.getConnection method now always returns a connection - The ConnectionPool.update mehtod now cleans the dead list - Deprecated the NoLivingConnectionsError
Mpdreamz
approved these changes
Mar 26, 2020
github-actions bot
pushed a commit
that referenced
this pull request
Mar 26, 2020
* Updated Connections handling - The ConnectionPool.getConnection method now always returns a connection - The ConnectionPool.update mehtod now cleans the dead list - Deprecated the NoLivingConnectionsError * Updated test * Updated docs * The NoLivingConnectionsError can still happen if the filter/selector returns no nodes * Updated test * Updated docs * Catch undefined connections as well * Updated test * Updated ApiError type def
delvedor
added a commit
that referenced
this pull request
Mar 26, 2020
* Updated Connections handling - The ConnectionPool.getConnection method now always returns a connection - The ConnectionPool.update mehtod now cleans the dead list - Deprecated the NoLivingConnectionsError * Updated test * Updated docs * The NoLivingConnectionsError can still happen if the filter/selector returns no nodes * Updated test * Updated docs * Catch undefined connections as well * Updated test * Updated ApiError type def
delvedor
added a commit
that referenced
this pull request
Jul 30, 2020
* Updated Connections handling - The ConnectionPool.getConnection method now always returns a connection - The ConnectionPool.update mehtod now cleans the dead list - Deprecated the NoLivingConnectionsError * Updated test * Updated docs * The NoLivingConnectionsError can still happen if the filter/selector returns no nodes * Updated test * Updated docs * Catch undefined connections as well * Updated test * Updated ApiError type def
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.
This pr introduces two changes in the internals of the client:
The
ConnectionPool.getConnection
method now always returns a connectionUntil now, the
ConnectionPool.getConnection
was returningnull
if there were no longer alive connections; while this solution makes sense, in some cases might cause an endless loop of failures, as running a sniff for refreshing the node list would be impossible.There is still a case where the
ConnectionPool.getConnection
returnsnull
, which happens if the filter/selector returns no nodes. For improving the debugging experience, theNoLivingConnectionsError
error message has been updated.The
ConnectionPool.update
method now cleans the dead listIt can happen in a situation where we are updating the connections list and running sniff, leaving the
dead
list in a dirty state. Now theConnectionPool.update
cleans up thedead
list every time, which makes way more sense given that all the new connections are alive.Fixes: #1122.