From: Remi Gacogne Date: Wed, 3 May 2023 14:37:36 +0000 (+0200) Subject: dnsdist: check that the UDP responder thread is running after reconnecting X-Git-Tag: dnsdist-1.8.1~10^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1f21a0a394a2d8a41201a20ea6869530e94c379d;p=thirdparty%2Fpdns.git dnsdist: check that the UDP responder thread is running after reconnecting (cherry picked from commit bb1ace1fedca0f6bdd2a962514cd5a6491f3c703) --- diff --git a/pdns/dnsdistdist/dnsdist-backend.cc b/pdns/dnsdistdist/dnsdist-backend.cc index 40e7033ac9..97cd0e46ec 100644 --- a/pdns/dnsdistdist/dnsdist-backend.cc +++ b/pdns/dnsdistdist/dnsdist-backend.cc @@ -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);