From 5e6e2c8773dd8e3037d9195452dc5e423367e1b0 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Thu, 12 Jul 2018 20:22:17 +0200 Subject: [PATCH] Reset shmem_exit_inprogress after shmem_exit() In ad9a274778d2d88c46b90309212b92ee7fdf9afe, shmem_exit_inprogress was introduced. But we need to reset it after shmem_exit(), because unlike the similar proc_exit(), shmem_exit() can also be called for cleanup when the process will not exit. Reported-by: Andrew Gierth --- src/backend/storage/ipc/ipc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/backend/storage/ipc/ipc.c b/src/backend/storage/ipc/ipc.c index 53f7c1e77e..a85a1c6de5 100644 --- a/src/backend/storage/ipc/ipc.c +++ b/src/backend/storage/ipc/ipc.c @@ -272,6 +272,8 @@ shmem_exit(int code) on_shmem_exit_list[on_shmem_exit_index].function(code, on_shmem_exit_list[on_shmem_exit_index].arg); on_shmem_exit_index = 0; + + shmem_exit_inprogress = false; } /* ----------------------------------------------------------------