]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#8850 Wait until backends are closed before freeing connection_pool
authorOndřej Kuzník <ondra@openldap.org>
Wed, 9 May 2018 15:07:11 +0000 (16:07 +0100)
committerOndřej Kuzník <ondra@openldap.org>
Fri, 19 Oct 2018 12:08:09 +0000 (13:08 +0100)
servers/slapd/daemon.c
servers/slapd/init.c

index 42bb931ca6b9412ac1278db7f0da7ac68077c396..2bdb60aa1d74e6ff674fac41cf1f8d261b3c9b96 100644 (file)
@@ -3073,7 +3073,7 @@ loop:
                        "slapd shutdown: waiting for %d operations/tasks to finish\n",
                        t, 0, 0 );
        }
-       ldap_pvt_thread_pool_destroy( &connection_pool, 1 );
+       ldap_pvt_thread_pool_close( &connection_pool, 1 );
 
        return NULL;
 }
index d87f4c421136ed30fb39478bc4d5e3cbeadb85af..eee96eddf3ea97f1cb303395465d85c4236e13d0 100644 (file)
@@ -229,6 +229,9 @@ int slap_shutdown( Backend *be )
                "%s shutdown: initiated\n",
                slap_name, 0, 0 );
 
+       /* Make sure the pool stops now even if we did not start up fully */
+       ldap_pvt_thread_pool_close( &connection_pool, 1 );
+
        /* let backends do whatever cleanup they need to do */
        return backend_shutdown( be ); 
 }
@@ -245,6 +248,8 @@ int slap_destroy(void)
                ber_bvarray_free( default_referral );
        }
 
+       ldap_pvt_thread_pool_free( &connection_pool );
+
        /* clear out any thread-keys for the main thread */
        ldap_pvt_thread_pool_context_reset( ldap_pvt_thread_pool_context());