model-writtenrun 4792 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Andres Freund reported that libpqrcv_connect() leaked its libpq connection on failure, proposed calling PQfinish(), and initially questioned whether backpatching was worthwhile because walreceiver normally exits afterward #1.
- Andres then identified file-descriptor exhaustion through failed CREATE SUBSCRIPTION attempts and attached a patch that frees connection resources and makes search-path setup failures return NULL with an error message, matching the function's contract #2.
- Noah Misch approved the fix, considered it safe to backpatch, and suggested controlling error verbosity if platform-dependent messages complicated regression testing #3.
- Andres chose invalid connection syntax and port=-1 for regression tests because the latter fails during connection establishment without opening a socket, allowing simple subscription.sql coverage instead of a TAP test; Noah endorsed this approach #4 #5.
- Andres committed the attached implementation unchanged with the agreed regression tests as bc54ef4ec2, with backpatching through PostgreSQL 11, and closed the thread by confirming it was pushed #6.