model-writtenrun 6835 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Jelte Fennema-Nio proposed raising the postmaster and pgbench soft file limits to their hard limits, motivated by low defaults, difficult operating-system configuration, and io_uring descriptor demand #1.
- Tom Lane raised resource-exhaustion and portability concerns, then emphasized preserving safe limits for external programs using select(), while Andres Freund proposed budgeting already-open descriptors plus max_files_per_process instead of raising the server limit indiscriminately #2 #4 #3 #8.
- Tomas Vondra called for visibility into descriptor-cache pressure and effective limits; Tom suggested reflecting max_safe_fds in max_files_per_process, while eviction counters and additional monitoring remained discussion ideas #6 #7 #11 #14.
- Andres explained that io_uring descriptors were created before the existing limit calculation, prompting discussion of delaying their creation, performing two adjustment rounds, or increasing limits through external-FD allocation #10 #13 #15.
- Jelte split the work into pgbench adjustment, demand-driven server adjustment with subprocess-limit restoration, and effective-limit reporting #16.
- Andres requested conditional pgbench adjustment, a shared system() wrapper, preservation of the original limit across repeated probing, and proper GUC override reporting; Tom also requested handling an insufficient hard limit #17 #18.
- Jelte revised pgbench to raise its limit only to nclients + 3 and reported that restoring a low limit around popen() could prevent creation of the parent-side pipe, initially choosing to leave that case unrestored #19.
- Andres committed the pgbench portion of #19 as d38bab5edd, adding only the operating-system error text to the failure diagnostic, and announced the landing #20.
- The remaining server series added a System wrapper, corrected saved-limit and EMFILE handling, and switched effective-limit reporting to SetConfigOption; two immediate revisions fixed a Windows warning and removed redundant conditional code #21 #22 #23.
- After Jelte rebased the server series #24, Andres committed the related additional-file accounting change as adb5f85fa5 from the later matching submission #586819 in the AIO thread thread #50208; that version retained reserved-descriptor accounting and updated documentation and diagnostics, while this thread's automatic limit increases and effective-limit reporting remained pending.
- Heikki Linnakangas questioned the wrapper's location, name, and coupling between wait-event reporting and restore-command behavior, and asked about implementing popen with fork and exec #25.
- Jelte moved the wrapper to fd.c as pg_system and renamed the limit helpers, but retained the restore-command coupling to preserve signal-handling constraints and again deferred a custom popen implementation because of its complexity #26.
- After a long gap, Peter Eisentraut reported missing pg_system declarations; Jelte refreshed the series with the required header and clarified that pgbench had already landed for PostgreSQL 18 #27 #28.
- Jelte subsequently replaced the wrapper approach with custom pg_system, pg_popen, and pg_pclose implementations that restore limits only after fork in the child, protecting select()-based executables without temporarily lowering the parent's limit; this merged the preparatory and server patches and adjusted an initdb test for additional logging #29.
- The redesigned two-patch series was rebased in March and July 2026, with the latter adapting to PostgreSQL's renamed signal-handler constants #30 #31.
- Surya Poondla reported a joint review with Haibo that supported the limit policy but questioned child-side operations under future threading, highlighted possible overflow fragility, and identified a stale function comment; Jelte requested clarification and acknowledged the smaller concerns #32 #33.
- Surya pinpointed child-side ereport() as unsafe for future threading, requested an explicit post-fork constraint and checked dup2 failures, and withdrew the posix_spawn suggestion because it could not portably set the required resource limit #34.
- Jelte's final revision removed child-side error reporting, documented the constraint, checked descriptor setup failures, and fixed close-on-exec handling #35; the server-limit increase and effective-GUC reporting remained uncommitted, with no demonstrated resolution of the earlier overflow and stale-comment concerns #32.