model-writtenrun 4679 - 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 a reproducer showing server descriptors inherited by COPY subprocesses and proposed close-on-exec flags for data files, WAL files, and backend sockets, with a zero-valued Windows flag because PostgreSQL already creates non-inheritable file handles there #1.
- Thomas corrected the standards reference to SUSv4 #2, and Tom Lane observed that an unexpected platform lacking O_CLOEXEC could retain its existing behavior through a zero-valued fallback #3.
- Andres Freund supported the fix and raised listening sockets and logging pipes #4; after Tom Lane questioned socket-flag inheritance under EXEC_BACKEND #5, Andres tested Linux and showed that accepted sockets require their own close-on-exec setting #6.
- Thomas expanded the series with accept4() and libpq SOCK_CLOEXEC/SOCK_NONBLOCK support, retaining an EXEC_BACKEND fallback and explaining that subprocess access to redirected logging output is intentional; detection of future platform support remained a discussion point #7.
- Thomas added the previously missed postmaster watch-pipe descriptor #8, then moved automatic O_CLOEXEC enforcement into the VFD layer, leaving raw-descriptor wrappers caller-controlled because extensions might intentionally pass descriptors to subprocesses #9.
- The expanded series also added pipe2() support and separated obsolete macOS guards into a cleanup; Thomas abandoned a Linux-specific regression-test idea and left a discovered pg_regress log-descriptor leak outside this work #9.
- The macOS cleanup from #9 landed with unchanged code as a1f45f69bb; when Gregory Stark reported CI application failures #10, Thomas explained that an already committed series member caused them #11.
- The main descriptor-inheritance patch from #9 landed as 1da569ca1f with comment and commit-message edits, and Thomas reposted the three remaining optimizations while waiting for build-farm feedback and further comments #12.
- The libpq member of #12 landed as bfc9497ece with explanatory comment edits; Thomas reported positive build-farm results and explicitly deferred accept4() and pipe2() because they only saved relatively rare system calls, while noting remaining platform-availability considerations #13.