model-writtenrun 7873 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Bharath Rupireddy reported that dropping a user mapping or foreign server could leave cached remote connections open until session exit, and proposed a global flag to trigger transaction-end cleanup in #1.
- Zhihong Yu questioned whether callback interleaving could invalidate that flag in #2; Bharath explained that the backend callbacks do not execute concurrently in #3.
- Zhijie Hou identified lost coverage of the GetConnection() cleanup path in #4, prompting Bharath to consider isolation or TAP tests for cross-session invalidation in #6.
- Fujii Masao supplied a replacement patch in #7 that immediately closes invalidated connections unused by the current transaction and defers cleanup of active connections until transaction end, eliminating the global flag and unnecessary cache scans; Bharath accepted this approach in #8.
- Fujii recommended retaining the existing regression test because it still exercises invalidation cleanup and keeping the defensive GetConnection() cleanup in #9; Bharath agreed and added coverage for transaction-end disconnection in #10.
- Fujii clarified that connections can be closed during a transaction provided that transaction has not used them in #11, and Bharath incorporated those comment changes in the final patch #12.
- Fujii accepted the final version in #13 and committed it unchanged as e3ebcca843, with backports to all supported branches; the thread ended with his push confirmation in #14 and no outstanding patch revisions.