Register llvm_shutdown using on_proc_exit, not before_shmem_exit.
authorDaniel Gustafsson <[email protected]>
Fri, 17 Nov 2023 10:46:27 +0000 (11:46 +0100)
committerDaniel Gustafsson <[email protected]>
Fri, 17 Nov 2023 10:46:27 +0000 (11:46 +0100)
This seems more correct, because other before_shmem_exit calls may
expect the infrastructure that is needed to run queries and access the
database to be working, and also because this cleanup has nothing to
do with shared memory.

This is a back-patch of bab150045bd9.

There were no known user-visible consequences to this, though, apart
from what was previous fixed by commit 303640199d0 and back-patched
as commit bcbc27251d35 and commit f7013683d9bb, so bab150045bd9 was
not no back-patched at the time.

Bharath Rupireddy

Discussion: http://postgr.es/m/CALj2ACWk7j4F2v2fxxYfrroOF=AdFNPr1WsV+AGtHAFQOqm_pw@mail.gmail.com
Backpatch-through: 13, 12

src/backend/jit/llvm/llvmjit.c

index 50e0deae623e45836759840572ec94c7503925f4..8809cb63ec2fa512103b4dfc691bfdb9be7c0895 100644 (file)
@@ -921,7 +921,7 @@ llvm_session_initialize(void)
    }
 #endif                         /* LLVM_VERSION_MAJOR > 11 */
 
-   before_shmem_exit(llvm_shutdown, 0);
+   on_proc_exit(llvm_shutdown, 0);
 
    llvm_session_initialized = true;