model-writtenrun 5838 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Jelte Fennema-Nio opened the thread with a patch making PQcancel inherit tcp_user_timeout, explaining that ignored connection options could leave its blocking API stuck during network failures #1.
- Zhihong Yu suggested a shorter field name #2, but Jelte retained consistency with PGconn and expanded the patch to keepalives after a production cancellation socket remained open for more than two days waiting for EOF #3 #4.
- Fujii Masao questioned extending deprecated PQrequestCancel and suggested reusing socket-option helpers #5; Tom Lane instead proposed making that API a wrapper and warned that shared helpers, PGconn access, and the broken Windows code threatened signal safety #6.
- Jelte accepted the wrapper and cleanup direction and proposed a future asynchronous cancellation API that could reuse normal connection setup #7; his December revision removed Windows support, cleaned up the socket-option patch, and added a separate connect_timeout implementation using nonblocking connect and select #8.
- Andres Freund objected to platform divergence, requested reduced duplication and separate refactoring, and opposed backpatching #9; Tom likewise considered the change a new feature too risky for stable branches #10.
- Jelte split the work into refactoring, socket options, and connect_timeout, removed internal_cancel, and proposed separate stable-branch documentation explaining the existing limitation while continuing to argue that it was a bug #11.
- Tom revised the first two patches, restored Windows support, fixed cleanup, and strengthened the signal-safety warning for PQrequestCancel, but declined connect_timeout because its risk outweighed its demonstrated benefit #12.
- Tom made PQcancel mirror the existing behavior of disabling tcp_user_timeout when keepalives are disabled, while questioning whether that coupling was correct #12, then added an optional_setsockopt compilation guard and noted uncertainty about Windows test coverage #13.
- Tom discovered that strerror and strerror_r were unsafe in signal handlers #14, while Jelte endorsed the cleaned-up Windows-capable patch and reported separate work on a nonblocking cancellation API #15.
- The signal-safety investigation produced f3f467b8f6, which replaced strerror with numeric errno formatting, and 2131c049d3, which moved gettext calls outside cancellation handlers; both were backpatched and neither had a matching attached patchset.
- Before landing the feature, Tom questioned whether the socket options could actually bound connection establishment #16; Jelte supplied a packet-drop reproduction and explained how overloaded Citus workers and failover had stranded cancellation sockets #17.
- Tom reproduced the timeout behavior on RHEL8 and withdrew his objection in the final message #18, then committed both patches from #13 together with only comment edits as 5987feb70b.
- The socket-option feature landed only on the development branch, while explicit connect_timeout support was declined #12; the stable-branch documentation proposal #11 has no recorded landing here, and the separate asynchronous API work #15 remains outside this thread's completed changes.