]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: check that the UDP responder thread is running after reconnecting
authorRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 3 May 2023 14:37:36 +0000 (16:37 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 12 May 2023 14:36:13 +0000 (16:36 +0200)
pdns/dnsdistdist/dnsdist-backend.cc

index cc49a7d42f0ef6e384c53002f28f6aeabc0510e8..8426cdd2566be2889e76a0c9a972b470a98856e0 100644 (file)
@@ -121,6 +121,12 @@ bool DownstreamState::reconnect(bool initialAttempt)
   if (connected) {
     tl.unlock();
     d_connectedWait.notify_all();
+    if (!initialAttempt) {
+      /* we need to be careful not to start this
+         thread too soon, as the creation should only
+         happen after the configuration has been parsed */
+      start();
+    }
   }
 
   return connected;
@@ -775,7 +781,6 @@ void DownstreamState::submitHealthCheckResult(bool initial, bool newResult)
 
     if (newState && !isTCPOnly() && (!connected || d_config.reconnectOnUp)) {
       newState = reconnect();
-      start();
     }
 
     setUpStatus(newState);