edgedb / edgedb-java

The official Java client library for EdgeDB
Apache License 2.0
19 stars 4 forks source link

Fix transaction deadlock in client pool #22

Closed quinchs closed 1 year ago

quinchs commented 1 year ago

Summary

When running a transaction with the transaction() method on EdgeDBClient, a client is fetched or created from the underlying client pool. The client from the pool is used to run the entire transaction block, the issue is that the binding didn't return the client back to the pool after use.

This PR fixes this by explicitly calling the close method on the client after the transaction block completes (successfully or not) via the composeWith method.

Fixes #21

quinchs commented 1 year ago

@petersamokhin Did the bug also occur with non-transactional code? I couldn't find anything thru non-transactional fuzzing

petersamokhin commented 1 year ago

@quinchs yes, it happened even outside transactions 🥲