model-writtenrun 5052 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Nathan Bossart reported that changing archive_library could invoke the shutdown callback twice and proposed replacing redundant error cleanup and direct calls with before_shmem_exit, since archiver ERRORs already terminate the process #1.
- Bharath Rupireddy endorsed that approach and suggested registering the callback in PgArchiverMain(); Michael Paquier questioned the benefit of earlier registration and proposed clearer lifecycle documentation plus a shell_archive DEBUG1 callback for testing #2 #3.
- Kyotaro Horiguchi supported before_shmem_exit, registration near the existing exit hook, and DEBUG1 logging, while Michael explicitly confirmed agreement on removing PG_ENSURE_ERROR_CLEANUP #4 #5 #6.
- Bharath submitted a revision incorporating Nathan's fix, earlier registration, a renamed wrapper, documentation changes, and a shell_archive shutdown callback with a TAP test #7.
- Michael committed that revision as 9668c4a661, restoring registration after module initialization, refining naming and comments, dropping the shutdown-documentation rewrite, and correcting the test.
- The thread ended with Michael confirming completion and explaining that the omitted documentation misleadingly suggested postmaster shutdown only, while the test needed reload synchronization, bounded log scanning, and removal of redundant postmaster.pid polling #8.