GODRIVER-1658 Fix connection updates to topology #429
Merged
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.
The change itself is simple: we no longer update the topology for successful connection handshakes because doing so doesn't gain us much and could actually hurt because it can cause resource contention if the applcation has many concurrent operations making connections, which would all try to update the topology even during steady-state. This PR also moves the SDAM error handling for connection handshakes to be earlier. Instead of doing it when a connection is checked out, we now do it inside
connection.connect
itself. This prevents an error from sitting around for a long time in the pool before it's actually processed and/or becomes stale.@iwysiu This will probably require changes to your code for GODRIVER-1572 as well.