model-writtenrun 648 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Lars Kanis reported ruby-pg hangs against servers using larger TLS records and proposed repeatedly calling pqReadData() from PQconsumeInput() until SSL's buffered data was exhausted #1.
- Jacob Champion independently reproduced the hang with Python/psycopg2 and questioned whether GSS and other libpq entry points needed the same protection #2 #4.
- Returning to the investigation in July 2025, Jacob reproduced a GSS hang and a separate PQconnectPoll() deadlock, establishing that the fix needed to cover pqReadData() generally rather than only PQconsumeInput() #7 #8 #10.
- Merlin Moncure described similar stalls with dblink and large amounts of notice output, providing another practical manifestation of the suspected buffering problem #9 #11.
- Andres Freund raised memory bounds, OpenSSL readahead performance, and the possibility of reading more data before polling; Jacob argued for draining a bounded amount of already buffered transport data and asserting that readahead remained disabled under the existing architecture #12 #14 #15 #16 #17 #18.
- Jacob replaced the original patch with two changes: extend the internal pending-data check to GSS, then drain SSL/GSS buffers at the end of pqReadData(), choosing a backportable implementation over a broader networking rewrite #19.
- Andres cautioned against entrenching restrictions on lower-layer buffering, while Jacob clarified that the immediate goal was to fix deadlocks on all branches without ruling out future redesign; the next revision expanded the architectural explanation and requested independent correctness, performance, and memory-bound verification #21 #22 #23.
- A customer failure involving ordinary PostgreSQL behind a TLS-terminating proxy brought Heikki Linnakangas into the work; he retained the draining approach but moved buffer management into a shared caller using pqsecure_bytes_pending() and pqsecure_read(), eliminating transport-specific access to conn->inBuffer #24 #25.
- Mark Dilger found that the rewritten drain function failed to advance conn->inEnd, and Heikki supplied a corrected revision plus a reproducer demonstrating failure before the correction and success afterward #26 #27.
- Solai reported successful repeated async and large SSL COPY tests, after which Heikki polished the documentation and redistributed changes between the two patches without changing their combined behavior #28 #29.
- Heikki committed both patches from #29 unchanged as the GSS pending-data fix ffd080d94f and the general buffer-draining fix 343594a26d, announcing backpatches to all supported versions #30.
- Peter Eisentraut then identified that a negative read result could incorrectly decrement conn->inEnd and print as an unsigned value; Heikki supplied explicit error handling and clarified the no-short-read contract in a follow-up patch #31 #32.
- Daniel Gustafsson separately reported a LibreSSL build failure on macOS because INT_MAX lacked its declaring header and supplied an explicit limits.h inclusion #33.
- Heikki committed Daniel's inclusion patch unchanged as d293f03455 and his error-handling patch unchanged as 17accbe0f4, then announced both follow-ups #34.
- The thread ended with Daniel confirming that master built against LibreSSL on macOS; all submitted fixes had landed, while Heikki's separate question about extending SSL's EOF-handling precaution to GSS remained outside the committed series, and OpenSSL readahead support remained deferred #35 #29 #25.