Revert "Fix Pgpool-II child process crash during shutdown."
authorTatsuo Ishii <ishii@postgresql.org>
Sat, 9 Nov 2024 06:34:57 +0000 (15:34 +0900)
committerTatsuo Ishii <ishii@postgresql.org>
Sat, 9 Nov 2024 06:34:57 +0000 (15:34 +0900)
This reverts commit 6dd66297db3acc5a9af4eb43ba7b5037102a8f0e.

Per discussion: [pgpool-general: 9265] Re: Segmentation fault during shutdown
https://www.pgpool.net/pipermail/pgpool-general/2024-November/001942.html

src/protocol/child.c

index 5d50619de8d47bd0680442a52abd4ede92f56b45..b817e5820afc23aa448cacbfdebaacfda38f340a 100644 (file)
@@ -1307,12 +1307,9 @@ child_will_go_down(int code, Datum arg)
                memcached_disconnect();
        }
 
-       /*
-        * We used to call close_all_backend_connections() here so that we send
-        * 'X' (terminate) message to backend. However it was possible that the
-        * function is called while initializing the connection pool object, which
-        * leads to crash. So we stopped to call close_all_backend_connections().
-        */
+       /* let backend know now we are exiting */
+       if (pool_connection_pool)
+               close_all_backend_connections();
 }
 void
 child_exit(int code)