model-writtenrun 9886 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Eric Cyr reported that file_fdw PROGRAM queries could fail when LIMIT stopped consumption early, including LIMIT 0, and Tom Lane reproduced the broken-pipe failure on Linux and macOS #1 #2.
- Tom traced the failure to programs inheriting the backend's ignored SIGPIPE disposition and posted a proof of concept that restored default handling around popen() and ignored SIGPIPE exits #3.
- Kyotaro Horiguchi and Etsuro Fujita warned that unconditional suppression could hide failures on unrelated pipes or degrade COPY TO diagnostics; Kyotaro added EOF tracking to distinguish early closure from a program ending unexpectedly #4 #5 #6.
- Thomas Munro demonstrated differing external-program behavior and questioned SIGPIPE-only suppression, while Kyotaro posted a version ignoring all unsuccessful exits after early closure #7 #9.
- Etsuro opposed hiding failures that might invalidate received data, and Thomas specifically rejected ignoring crash signals; experiments with Ruby reinforced that SIGPIPE-only handling would not cover programs converting broken pipes into ordinary failure exits #11 #12 #15 #17 #19.
- Etsuro returned to Tom's original approach, adding an explicit allow_partial argument to BeginCopyFrom() and resetting SIGUSR2 as well as SIGPIPE for external programs #20.
- Tom rejected changing the public API in a backpatched fix and replaced the permission flag with COPY-direction and EOF tracking inside copy.c, retaining error reporting except for SIGPIPE after early closure #21 #22 #23.
- Tom settled on a zero-byte read as the EOF test and accepted that stopping at an in-band EOF marker would also make subsequent SIGPIPE ignorable, favoring fewer questionable errors over additional enforcement code #24 #25.
- The signal audit prompted a separate cleanup: Tom proposed preserving inherited SIGTTIN/SIGTTOU handling throughout postmaster children and removing Windows definitions that collided with SIGABRT, clarifying that these side issues did not need backpatching #26 #27 #28.
- The side discussion landed as 125f551c8b, which removed child-process signal resets including redundant SIGCONT/SIGWINCH calls, and 37afc079ab, which removed the Windows definitions and guarded the postmaster calls.
- Kyotaro still favored ignoring every error after early closure, while Etsuro supported Tom's API-preserving implementation and its more precise SIGPIPE handling #29 #30.
- Tom committed #23 with modifications as ffa4cbd623, backpatched through PostgreSQL 10, dropping SIGUSR2 resetting because its temporary default disposition could terminate the backend #31.
- The thread ended with the SIGPIPE fix and both signal cleanups landed; broader error suppression and a configurable file_fdw policy were left unimplemented, and SIGUSR2 inheritance remained unchanged #19 #29 #31.