I tested the latest patch with PgBouncer in session pooling mode (pool size 20, 21 clients).
Before applying the patch, pgbench got stuck under this setup and eventually hit a query_wait_timeout error.
After applying the patch, pgbench runs smoothly even when clients are queued. I can see continuous progress output and normal throughput (~60k TPS), with no errors or stalls.