]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#9930 Just wait until si_mutex is ready
authorOndřej Kuzník <ondra@mistotebe.net>
Wed, 18 Jan 2023 12:28:05 +0000 (12:28 +0000)
committerQuanah Gibson-Mount <quanah@openldap.org>
Thu, 19 Jan 2023 17:50:01 +0000 (17:50 +0000)
We're in a much better place now and there is only a single task active
for a given syncinfo_t plus the task that's just scheduled it and is
wrapping up. Any remaining times this wouldn't be true are probably bugs
to be fixed.

servers/slapd/syncrepl.c

index b26cb325168d3d15d156d8ef3d3b3b827a32d073..4d4ba540c82a8861f64e58f0f347fa9c3564e22f 100644 (file)
@@ -2054,13 +2054,7 @@ do_syncrepl(
 
        Debug( LDAP_DEBUG_TRACE, "=>do_syncrepl %s\n", si->si_ridtxt );
 
-       /* Don't get stuck here while a pause is initiated */
-       while ( ldap_pvt_thread_mutex_trylock( &si->si_mutex )) {
-               if ( slapd_shutdown )
-                       return NULL;
-               if ( !ldap_pvt_thread_pool_pausewait( &connection_pool ))
-                       ldap_pvt_thread_yield();
-       }
+       ldap_pvt_thread_mutex_lock( &si->si_mutex );
 
        si->si_too_old = 0;