Fixed issue with connection pool deactivation #463
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.
Previously load balancer moved connection pool to deactivated state when corresponding cluster member had a network error. This was made to disallow any new connections towards that member. Member has also been removed from the routing table, so that callers never try to acquire connection from a deactivated pool. Deactivated pools were re-activated during rediscovery.
However, there was a case when deactivated pool towards the seed router would remain deactivated forever without a chance to be re-activated. It happened when connections to all cores failed and driver had to perform rediscovery using seed router. In this case all connections pools were deactivated, and rediscovery was not able to complete because it failed trying to obtain connection from a deactivated pool.
This PR fixes the problem by removing pool activation/deactivation. Instead driver will simply make instance non-routable by removing it's address from the routing table. Corresponding connection pool will not be changed. Later rediscovery will cleanup pools for non-routable addresses that have no active connections.
Same connection error handling logic is in 1.5. Only tests should be merged forward.