]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Run cache_peer probes without transaction context (#1256)
authorEduard Bagdasaryan <eduard.bagdasaryan@measurement-factory.com>
Fri, 10 Feb 2023 15:44:18 +0000 (15:44 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Sun, 12 Feb 2023 23:44:04 +0000 (23:44 +0000)
Even when triggered by a master transaction, these background probes
should not be associated with it. That transaction just wants to know
whether the neighbor is "up" right now. The transaction does not wait
(and is not aware of) the background probe its question may or may not
have triggered.

src/neighbors.cc

index b0f235dd97339ac121bfbf98d392e4cb220b00c9..766d912e6c310dab4b64d96984694f8e5c81afbb 100644 (file)
@@ -1145,7 +1145,10 @@ int
 neighborUp(const CachePeer * p)
 {
     if (!p->tcp_up) {
-        peerProbeConnect(const_cast<CachePeer*>(p));
+        // TODO: When CachePeer gets its own CodeContext, pass that context instead of nullptr
+        CallService(nullptr, [&] {
+            peerProbeConnect(const_cast<CachePeer*>(p));
+        });
         return 0;
     }