]> granicus.if.org Git - pdns/commitdiff
rec: Load the Lua script in the distributor threads, for TCP
authorRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 8 Jan 2019 13:55:44 +0000 (14:55 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 21 Jan 2019 14:43:29 +0000 (15:43 +0100)
pdns/pdns_recursor.cc

index bfc392f46cd92f4e56d1ab7f4498fa058c7acb2e..606da49e61c9f06a131cf020e6c5ff0d802cf02d 100644 (file)
@@ -3959,8 +3959,9 @@ try
   if (threadInfo.isWorker)
     setupNODThread();
 #endif /* NOD_ENABLED */
-  
-  if(threadInfo.isWorker) {
+
+  /* the listener threads handle TCP queries */
+  if(threadInfo.isWorker || threadInfo.isListener) {
     try {
       if(!::arg()["lua-dns-script"].empty()) {
         t_pdl = std::make_shared<RecursorLua4>();
@@ -4096,7 +4097,8 @@ try
     }
     if (t_pdl != nullptr) {
       // lua-dns-script directive is present, call the maintenance callback if needed
-      if (threadInfo.isWorker) {
+      /* remember that the listener threads handle TCP queries */
+      if (threadInfo.isWorker || threadInfo.isListener) {
         // Only on threads processing queries
         if(g_now.tv_sec - last_lua_maintenance >= luaMaintenanceInterval) {
           t_pdl->maintenance();