]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Refuse to start with retrieval-threads=0 if configuration needs any. 16116/head
authorMiod Vallat <miod.vallat@powerdns.com>
Fri, 12 Sep 2025 08:32:28 +0000 (10:32 +0200)
committerMiod Vallat <miod.vallat@powerdns.com>
Fri, 12 Sep 2025 08:32:28 +0000 (10:32 +0200)
Fixes: #5343
Signed-off-by: Miod Vallat <miod.vallat@powerdns.com>
docs/settings.rst
pdns/auth-main.cc

index 482ec473e21c3a84a2677b9dbaa69d2be887f75c..a081c37dede18e0620531a6a70821e31e2402c0d 100644 (file)
@@ -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.
index f6e82e97d272ea01d78cabec9fff7e59eba00d88..ce8a785b6d1e20d390dd25e62815dc586469c464 100644 (file)
@@ -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"));