]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
Do not back off until we get a failure
authorOndřej Kuzník <ondra@mistotebe.net>
Mon, 10 Jul 2017 09:21:35 +0000 (10:21 +0100)
committerOndřej Kuzník <okuznik@symas.com>
Tue, 17 Nov 2020 17:55:46 +0000 (17:55 +0000)
servers/lloadd/backend.c

index 2e68994e6dbc47f8bf8b99f3da00b77e6dd4cff4..bdfe621bee1e13dced37d1e800a50046e031d443 100644 (file)
@@ -277,7 +277,8 @@ backend_retry( Backend *b )
     }
     if ( b->b_active + b->b_bindavail + b->b_opening < requested ) {
         if ( b->b_opening > 0 || b->b_failed > 0 ) {
-            if ( !event_pending( b->b_retry_event, EV_TIMEOUT, NULL ) ) {
+            if ( b->b_failed > 0 &&
+                    !event_pending( b->b_retry_event, EV_TIMEOUT, NULL ) ) {
                 Debug( LDAP_DEBUG_CONNS, "backend_retry: "
                         "scheduling a retry in %d ms\n",
                         b->b_retry_timeout );
@@ -287,7 +288,7 @@ backend_retry( Backend *b )
                 return;
             } else {
                 Debug( LDAP_DEBUG_CONNS, "backend_retry: "
-                        "retry already scheduled\n" );
+                        "retry in progress already\n" );
             }
         } else {
             Debug( LDAP_DEBUG_CONNS, "backend_retry: "
@@ -323,7 +324,8 @@ backend_connect( evutil_socket_t s, short what, void *arg )
 
     ldap_pvt_thread_mutex_lock( &b->b_mutex );
     Debug( LDAP_DEBUG_CONNS, "backend_connect: "
-            "attempting connection to %s\n",
+            "%sattempting connection to %s\n",
+            (what & EV_TIMEOUT) ? "retry timeout finished, " : "",
             b->b_host );
 
 #ifdef LDAP_PF_LOCAL