From: Miod Vallat Date: Fri, 12 Sep 2025 08:32:28 +0000 (+0200) Subject: Refuse to start with retrieval-threads=0 if configuration needs any. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F16116%2Fhead;p=thirdparty%2Fpdns.git Refuse to start with retrieval-threads=0 if configuration needs any. Fixes: #5343 Signed-off-by: Miod Vallat --- diff --git a/docs/settings.rst b/docs/settings.rst index 482ec473e..a081c37de 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -844,6 +844,7 @@ Forward DNS updates sent to a secondary to the primary. ------------------ - IP addresses, separated by commas +- Default: empty IP addresses to forward received notifications to regardless of primary or secondary settings. diff --git a/pdns/auth-main.cc b/pdns/auth-main.cc index f6e82e97d..ce8a785b6 100644 --- a/pdns/auth-main.cc +++ b/pdns/auth-main.cc @@ -776,6 +776,14 @@ static void mainthread() exit(1); // NOLINT(concurrency-mt-unsafe) we're single threaded at this point } } + // - configurations involving communicator threads need at least one + // such thread configured + if (::arg().mustDo("primary") || ::arg().mustDo("secondary") || !::arg()["forward-notify"].empty()) { + if (::arg().asNum("retrieval-threads", 1) <= 0) { + g_log << Logger::Error << R"(Error: primary or secondary operation requires "retrieval-threads" to be set to a nonzero value.)" << endl; + exit(1); // NOLINT(concurrency-mt-unsafe) we're single threaded at this point + } + } // (no more checks yet) PC.setTTL(::arg().asNum("cache-ttl"));