long2ice / asynch

An asyncio ClickHouse Python Driver with native (TCP) interface support.
https://github.com/long2ice/asynch
Apache License 2.0
185 stars 43 forks source link

Fix broken connections in pool #83

Closed pufit closed 1 year ago

pufit commented 1 year ago

Sometimes, the connection can fail on the connect stage due to some unexpected error (e.g., network error. Example stack trace: https://pastila.nl/?00413e13/61b1dde4391c8ca6c33e13c77b81d916#C8Y5TPqFSMYzm1jCC7aj7A==). In that case, the connection will be returned to the connection pool in a "broken" state, and all queries with this connection will fail with the records have not fetched error.

This PR should fix this problem.

pufit commented 1 year ago

Wow, I missed that yesterday there was exactly identical PR https://github.com/long2ice/asynch/pull/82 Disregard :sweat_smile: