diff --git a/src/protocol/child.c b/src/protocol/child.c index b817e5820..e7ca0be21 100644 --- a/src/protocol/child.c +++ b/src/protocol/child.c @@ -140,6 +140,11 @@ struct timeval startTime; bool stop_now = false; #endif +/* + * If true, connection pool has been initialized. + */ +static bool connection_pool_initialized = false; + /* * child main loop */ @@ -223,6 +228,7 @@ do_child(int *fds) { child_exit(POOL_EXIT_AND_RESTART); } + connection_pool_initialized = true; /* * Open pool_passwd in child process. This is necessary to avoid the file @@ -1308,7 +1314,7 @@ child_will_go_down(int code, Datum arg) } /* let backend know now we are exiting */ - if (pool_connection_pool) + if (connection_pool_initialized) close_all_backend_connections(); } void