model-writtenrun 3482 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Hao Zhang reported that a PL/Python function could corrupt interpreter state after a parallel-operation error and crash on a subsequent call, proposing Python exception handling around subtransaction startup in #1.
- Tom Lane revised Hao's patch by centralizing exception selection, completing error-state cleanup, and adding a test in #2, but questioned whether fixing individual procedural languages was appropriate and noted that the test did not reliably reproduce the leader-process crash.
- Andres Freund questioned whether other procedural languages were similarly affected in #3, while Tom explained the interpreter-state risk in #4; Hao subsequently reported no PL/Perl crash and pointed out that removing the parallel restriction would still leave allocation failures in #6.
- Tom argued that transaction-start failures were unsafe to recover from in #7, then replaced the PL/Python approach with a transaction-layer patch in #8 that allowed XID-less internal subtransactions in parallel mode and made remaining startup failures FATAL rather than PANIC.
- After nearly three months, Robert Haas supported the direction but requested more accurate documentation and narrower comments in #9; Tom defended retaining both parallel-mode and worker checks in #11, and Robert accepted that reasoning in #12.
- Tom's revision in #13 added parallelChildXact so nested subtransactions retained parallel restrictions, expanded documentation, and tested PL/pgSQL exception recovery; he verified that the original crash disappeared but omitted its Python-dependent reproducer from regression coverage.
- Robert's discussion of resource-leak warnings in #14 led Tom to make parallel-context cleanup unconditional and add parallelModeLevel warnings in #15.
- Robert questioned the cost and usefulness of those checks in #16, while Tom defended them as protection against programming mistakes in #17; Robert ultimately accepted proceeding despite his reservations in #20, and Tom confirmed his intention to commit in #21.
- The closing discussion explored reducing subtransaction cleanup costs through resource tracking, fast paths, or batching in #22, #23, and #26, but left those optimizations unresolved and outside the patch.
- Shortly after the final message, Tom committed #15 unchanged as 0075d78947, crediting Hao's report and Robert's review; the commit explicitly declined backpatching the broader change or adding a narrower PL/Python workaround to stable branches.