model-writtenrun 9609 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Thomas Munro opened the thread with traces of intermittent SSL certificate-rejection tests on eelpout: a startup-packet send sometimes failed before libpq read the server's useful SSL error #1 #3.
- After investigating local TCP behavior, Thomas found that the server's final data remained readable after ECONNRESET and demonstrated an inline fix calling pqHandleSendFailure after a failed startup-packet send #4 #7.
- Tom Lane objected that pqHandleSendFailure depended on query-start state and proposed replacing its scattered calls with general handling that records write failures, discards subsequent output, and reads available server messages before reporting the write error #8.
- Reproduction initially appeared specific to eelpout's OpenSSL or platform, leading Tom to defer the redesign until there was a demonstrable bug it would fix #13 #15 #16.
- Thomas's socket experiment showed that Linux, Darwin, and FreeBSD preserved the server's final message, while Shawn Debnath's Windows test could not retrieve it, leaving the related Windows failure without a demonstrated remedy #17 #18 #19.
- Thomas subsequently reproduced the SSL problem on x86 and learned that TLS 1.3 intentionally deferred client-certificate verification; Tom then reproduced it on macOS with OpenSSL 1.1.1a and an artificial delay #20 #21 #23.
- Tom posted the general libpq redesign, reporting successful SSL-failure and backend-disconnection tests while identifying a theoretical concern about waiting for input after a write failure and recommending HEAD-only adoption initially #24.
- Thomas tested the patch successfully on eelpout's host and examined the TCP assumptions, later qualifying that adverse network conditions might still prevent delivery of a server's final message #25 #27.
- Tom rejected back-patching the inline pqHandleSendFailure workaround because it relied on unsupported connection state, and proposed reconsidering the general fix after PostgreSQL 12 beta testing #26.
- Thomas proposed allowing both error messages in PostgreSQL 11's tests; Tom preferred that stopgap over restricting TLS versions, which would reduce test coverage #28 #29.
- Tom concluded that the patch should prioritize any available server error and that the feared indefinite wait lacked a plausible trigger; the thread ended with agreement to commit the redesign in HEAD and relax the PostgreSQL 11 tests, leaving a full back-patch for later consideration #30 #31.
- The libpq redesign from #24 landed as 1f39a1c064, with an added fallback for empty saved write-error messages and expanded explanatory comments.
- The separate PostgreSQL 11 stopgap landed as 08cf04bb47, accepting either SSL errors or unexpected connection closure in the two affected tests without back-patching the libpq redesign.