mirror of
https://github.com/element-hq/synapse.git
synced 2026-08-14 18:01:13 +00:00
A checkout from the Rust connection pool (`ConnectionPool.connect`) previously blocked indefinitely while waiting for a free slot or establishing a new connection, so an unreachable or overloaded server could hang the worker threads handling requests forever. Bound the whole checkout with a configurable timeout: deadpool's `wait` and `create` timeouts (enabled via its `rt_tokio_1` runtime feature, driven on our own tokio runtime). Hitting it raises an OperationalError, which Synapse already treats as a retryable operational error. Configurable via the `pool_checkout_timeout` database option (milliseconds; default 30s, `0` disables), read by the Rust engine and plumbed to both the connection pool and the bootstrap (pool-of-one) connection. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01W3G4M92AmwSSZCbmtMJU3d