Skip to content

Suppress pool was closed errors #597

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 3 commits into from
May 7, 2019
Merged

Conversation

zhenlineo
Copy link
Contributor

In a routing driver, it is possible that a thread will try to acquire a connection from a pool which might have been closed by another thread.
This happens when thread A obtains a server S to establish a connection. While thread B triggers updating routing table and removes server S from the routing table and connection pool. Then when thread A process to acquire a connection with server S, then we will end up with this pool was closed error.
This race condition cannot be avoided due to the nature of multi-threading. However when it happens, we can catch the error and treat it as a normal IO Error.

In a routing driver, it is possible that a thread will try to acquire a connection from a pool which might have been closed by another thread.
This happens when thread A obtains a server S to establish a connection. While thread B triggers updating routing table and removes server S from the routing table and connection pool. Then when thread A process to acquire a connection with server S, then we will end up with this pool was closed error.
This race condition cannot be avoided due to the nature of multi-threading. However when it happens, we can catch the error and treat it as a normal IO Error.
@zhenlineo zhenlineo requested a review from ali-ince May 6, 2019 20:02
All failures that will be retried or are temporary in the middle of updating routing table are now all marked as INFO.
Copy link
Contributor

@ali-ince ali-ince left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Had a couple of comments.

@zhenlineo zhenlineo merged commit ff9e61b into neo4j:1.7 May 7, 2019
@zhenlineo zhenlineo deleted the 1.7-pool-closed branch May 7, 2019 11:44
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