]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#8747 Protect shutdown code while workers are still alive
authorOndřej Kuzník <ondra@mistotebe.net>
Fri, 19 Feb 2021 08:54:45 +0000 (08:54 +0000)
committerQuanah Gibson-Mount <quanah@openldap.org>
Mon, 10 May 2021 18:49:13 +0000 (18:49 +0000)
servers/lloadd/daemon.c

index f60db22c675fe49fdfeab92e46e9622afb8fed25..d402dfe6b1a38986c6dc26aa201eb9462b83a278 100644 (file)
@@ -1332,10 +1332,14 @@ lloadd_daemon( struct event_base *daemon_base )
 
     /* Mark upstream connections closing and prevent from opening new ones */
     LDAP_CIRCLEQ_FOREACH ( b, &backend, b_next ) {
+        epoch_t epoch = epoch_join();
+
         checked_lock( &b->b_mutex );
         b->b_numconns = b->b_numbindconns = 0;
         backend_reset( b, 1 );
         checked_unlock( &b->b_mutex );
+
+        epoch_leave( epoch );
     }
 
     /* Do the same for clients */