model-writtenrun 8144 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Tom Lane opened the thread by identifying unsafe SIGQUIT exits in the archiver and startup-packet handling, proposing that both use SignalHandlerForCrashExit so they terminate through _exit(2) without running cleanup callbacks #1.
- Stephen Frost proposed extending the change to the statistics collector, but Tom Lane separated that work because its handler was not signal-unsafe and changing its normal shutdown convention would require a development-branch-only change #2 #3 #4.
- Tom Lane committed Kyotaro Horiguchi's archiver change as bedadc7322, replacing the private SIGQUIT handler with SignalHandlerForCrashExit and back-patching supported branches; Horiguchi later acknowledged the landing #15.
- Andres Freund highlighted the startup timeout handler, requested a less confusing name for startup_die(), and questioned whether buildfarm shutdowns exercised the dangerous paths sufficiently; Tom Lane proposed logging escalation to SIGKILL to expose otherwise hidden hangs #5 #6 #7 #8.
- Tom Lane considered moving ProcessStartupPacket into InitPostgres, then identified a smaller solution: because startup-packet processing has not modified shared memory, SIGTERM and timeout handlers could use _exit(1) without triggering crash recovery, with a check for prematurely registered shared-memory cleanup handlers #9 #11.
- Tom Lane first posted a conservative, back-patchable SIGQUIT fix that also renamed the handler and narrowed its active interval #12; it landed as 58c6feccfa with only naming and comment edits, leaving SIGTERM and timeout behavior for a separate change.
- A broader audit identified unsafe or questionable background-worker, recovery-conflict, and standby-timeout signal handling #13; Takayuki Tsunakawa raised related shutdown behavior, while Robert Haas and Tom Lane debated interrupt handling around background workers and ProcWaitForSignal without producing fixes for those issues here #14 #16 #17 #18 #19.
- Tom Lane posted the follow-up patch after testing forced SIGTERM and timeout exits, replacing proc_exit(1) with _exit(1) and adding the shared-memory cleanup-handler check #20.
- Tom Lane rejected delaying ProcessStartupPacket because startup errors need the client's protocol version for correct reporting, and retained the smaller fix while remaining cautious about back-patching it #21; #20 landed unchanged as 6693a96b32.
- The proposed SIGKILL diagnostic #8 landed separately as 10095ca634, adding a LOG message when shutdown or crash recovery escalates beyond SIGQUIT.
- Nearly three years later, Andres Freund reported recurring pre-v14 crashes involving StartupPacketTimeoutHandler interrupting allocation and invoking cleanup, providing field evidence for back-patching the _exit(1) fix #22.
- Tom Lane agreed to revisit back-patching after the imminent minor releases, and Andres Freund agreed there was no need for immediate action; the thread ends with all four development-branch changes landed but that back-patch decision still pending #23 #24.