model-writtenrun 9617 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Tomas Vondra reported that pgbench with rate limiting could hang after all connections closed, providing a reproducer and a backtrace showing select() waiting indefinitely with remains equal to zero #1.
- Fabien COELHO reproduced the issue on PostgreSQL 11.2 but not HEAD #3, and Tomas identified the existing HEAD fix as 3bac77c48f #4.
- Fabien supplied a minimal PostgreSQL 11 patch that exits the thread loop when throttling finishes its last client, before execution can reach the indefinite wait #5.
- After a four-month gap, Yoshikazu Imai reproduced the problem on PostgreSQL 11.4, confirmed that the patch prevented it and passed make check-world, and asked whether select() also needed a socket-validity guard #6.
- Fabien explained that remaining clients must either require a timed sleep or have pending server activity, making the extra guard unnecessary, and declined to add an assertion to a released version #7; Yoshikazu accepted the explanation and marked the patch ready for a committer #8.
- Tom Lane pushed the unchanged patch as 46c193213a for PostgreSQL 10 and 11, since HEAD and PostgreSQL 12 already had the fix, and closed the thread by announcing the push #10.