]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
rec: release ref to key in MTasker::waitEvent
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 28 Oct 2024 13:45:07 +0000 (14:45 +0100)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 28 Oct 2024 15:44:08 +0000 (16:44 +0100)
If we do not do that, only the next call of sendEvent will release
the shared pointer to the TCPConnectionHanlder in PacketID. This
might delay cleaning TCP objects up on not-so-busy threads.

Fixes #13422, thought it can still take a while on idle recursors,
as the housekeeping function is not called often in those cases.

pdns/recursordist/mtasker.hh

index a45f64d8326b75d6627bd5d9612a731fd8b64532..1287e94455e4bb68e90a80cb085fe43eb429c62c 100644 (file)
@@ -305,7 +305,7 @@ int MTasker<EventKey, EventVal, Cmp>::waitEvent(EventKey& key, EventVal* val, un
   if ((char*)&waiter < d_threads[d_tid].highestStackSeen) {
     d_threads[d_tid].highestStackSeen = (char*)&waiter;
   }
-  key = d_eventkey;
+  key = std::move(d_eventkey);
   return d_waitstatus;
 }