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: rec-4.9.0-beta1~7^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bb1ace1fedca0f6bdd2a962514cd5a6491f3c703;p=thirdparty%2Fpdns.git dnsdist: check that the UDP responder thread is running after reconnecting --- diff --git a/pdns/dnsdistdist/dnsdist-backend.cc b/pdns/dnsdistdist/dnsdist-backend.cc index cc49a7d42f..8426cdd256 100644 --- a/pdns/dnsdistdist/dnsdist-backend.cc +++ b/pdns/dnsdistdist/dnsdist-backend.cc @@ -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);