Problem
create_dynamic_pool() inserts a pool into POOLS with size == 0. Between insertion and the first server connection (created by get_server_parameters()), GC can remove the pool, causing No pool configured errors.
Currently mitigated with a 2-second grace period (created_at field on ConnectionPool, checked in gc.rs). This works but is a timing-based workaround.
Root cause
The pool is registered in POOLS before its first connection exists. GC sees size == 0 and removes it.
Failed structural fix
Attempted to split create_dynamic_pool into create + register phases (insert into POOLS only after get_server_parameters). This caused protocol hangs on second connection — root cause of the hang was not identified. Reverted in 760ac60.
Desired fix
Insert pool into POOLS only after the first connection is established, without breaking the auth flow for subsequent connections.
Reproduction
Only reproduced in CI (GitHub Actions runners). The SSLRequest roundtrip in prefer mode widens the GC window enough to trigger. With allow mode (default, no SSLRequest) the window is smaller but still exists in theory.
References
Problem
create_dynamic_pool()inserts a pool into POOLS withsize == 0. Between insertion and the first server connection (created byget_server_parameters()), GC can remove the pool, causingNo pool configurederrors.Currently mitigated with a 2-second grace period (
created_atfield onConnectionPool, checked ingc.rs). This works but is a timing-based workaround.Root cause
The pool is registered in POOLS before its first connection exists. GC sees
size == 0and removes it.Failed structural fix
Attempted to split
create_dynamic_poolinto create + register phases (insert into POOLS only afterget_server_parameters). This caused protocol hangs on second connection — root cause of the hang was not identified. Reverted in760ac60.Desired fix
Insert pool into POOLS only after the first connection is established, without breaking the auth flow for subsequent connections.
Reproduction
Only reproduced in CI (GitHub Actions runners). The SSLRequest roundtrip in
prefermode widens the GC window enough to trigger. Withallowmode (default, no SSLRequest) the window is smaller but still exists in theory.References
ad2fd7f089fc22, reverted in760ac60