model-writtenrun 8037 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Alexander Lakhin reported intermittent Windows ecpg connect/test5 failures in which clients lost the expected FATAL message, and demonstrated that delaying client reads reliably reproduced the problem and also affected pg_dump #1.
- Tom Lane suggested explicitly closing the backend socket on Windows, despite the existing policy of leaving it open until process exit #2.
- Alexander confirmed that explicit close fixed the failure and tested a shutdown-and-receive-loop alternative, but Tom rejected waiting for the client because it could indefinitely block backend exit #3 #4.
- Alexander submitted a Windows-only shutdown() plus closesocket() patch in src/backend/libpq/pqcomm.c, avoiding the receive loop, while also reporting a Linux recovery-test shutdown problem exposed by delayed reads #5.
- After Tom requested testing with client delays, Alexander reported that all 60 ecpg tests passed with a one-second delay; he separately traced the Linux recovery failure to repeated replication keepalives during smart shutdown #6 #7.
- The thread ended without a landing announcement and with the recovery issue unresolved; Kyotaro Horiguchi clarified that his previously referenced patch rejected an invalid backup rather than fixing an operation that might produce one #8.
- Tom later committed the Windows closesocket() fix with rewritten comments and without shutdown(), crediting Alexander and Lars Kanis as independent submitters and backpatching all supported branches; attribution follows Lars's later matching submission in thread #45117 #492697 6051857fc9.