neo4j / neo4j-go-driver

Neo4j Bolt Driver for Go
Apache License 2.0
482 stars 68 forks source link

Non-racing lock for driver pool #552

Closed robsdedude closed 6 months ago

robsdedude commented 7 months ago

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 commented 7 months ago

lock updates make sense to me 👍