]> 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>
Mon, 14 Aug 2023 14:36:00 +0000 (16:36 +0200)
(cherry picked from commit bb1ace1fedca0f6bdd2a962514cd5a6491f3c703)

pdns/dnsdistdist/dnsdist-backend.cc

index 40e7033ac9224e588d1e94acbb6460726fc03bce..97cd0e46ec5c8fef36e7f5f3b87d999572495cf1 100644 (file)
@@ -120,6 +120,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;
@@ -774,7 +780,6 @@ void DownstreamState::submitHealthCheckResult(bool initial, bool newResult)
 
     if (newState && !isTCPOnly() && (!connected || d_config.reconnectOnUp)) {
       newState = reconnect();
-      start();
     }
 
     setUpStatus(newState);