Skip to content
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

Non-racing lock for driver pool #552

Merged

Conversation

robsdedude
Copy link
Member

The mutex guarding the driver's pool attribute does not need to be held while doing IO. Therefore, we can use a standard (non-cancelable) mutex to guard it. This comes at the benefit of not needing a context for session creation. Session creation doesn't perform any I/O, so it shouldn't take long anyway. There's little to no gain in it accepting a context.

The mutex guarding the driver's pool attribute does not need to be held while
doing IO. Therefore, we can use a standard (non-cancelable) mutex to guard it.
This comes at the benefit of not needing a context for session creation. Session
creation doesn't perform any I/O, so it shouldn't take long anyway. There's
little to no gain in it accepting a context.
@StephenCathcart
Copy link
Contributor

lock updates make sense to me 👍

@StephenCathcart StephenCathcart merged commit 373bd39 into neo4j:5.0 Jan 4, 2024
5 checks passed
@robsdedude robsdedude deleted the context-cleanup/driver-close-mutex branch January 10, 2024 08:54
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.

None yet

2 participants