]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/syncrepl.c
ITS#6076 fix collectinfo ordering
[openldap] / servers / slapd / syncrepl.c
index 6b16e0470f9530c75a725cdabf1134b281d8d091..07e9dd78577fb08c33b472ac2a67a339204a7b06 100644 (file)
@@ -4631,21 +4631,13 @@ syncrepl_config( ConfigArgs *c )
                                                        isrunning = 1;
                                                } else {
                                                        if ( si->si_conn ) {
-                                                               isrunning = 1;
-                                                               /* If there's a persistent connection, we don't
-                                                                * know if it's already got a thread queued.
-                                                                * so defer the free, but reschedule the task.
-                                                                * If there's a connection thread queued, it
-                                                                * will cleanup as necessary. If not, then the
-                                                                * runqueue task will cleanup.
+                                                               /* If there's a persistent connection, it may
+                                                                * already have a thread queued. We know it's
+                                                                * not active, so it must be pending and we
+                                                                * can simply cancel it now.
                                                                 */
-                                                               ldap_pvt_thread_mutex_lock( &slapd_rq.rq_mutex );
-                                                               if ( !ldap_pvt_runqueue_isrunning( &slapd_rq, si->si_re )) {
-                                                                       si->si_re->interval.tv_sec = 0;
-                                                                       ldap_pvt_runqueue_resched( &slapd_rq, si->si_re, 0 );
-                                                                       si->si_re->interval.tv_sec = si->si_interval;
-                                                               }
-                                                               ldap_pvt_thread_mutex_unlock( &slapd_rq.rq_mutex );
+                                                               ldap_pvt_thread_pool_retract( &connection_pool,
+                                                                       si->si_re->routine, si->si_re );
                                                        }
                                                        ldap_pvt_thread_mutex_unlock( &si->si_mutex );
                                                }