]> git.ipfire.org Git - thirdparty/squid.git/commit
Fix FATAL ServiceRep::putConnection exception: theBusyConns > 0 (#939)
authorAlex Rousskov <rousskov@measurement-factory.com>
Sun, 28 Nov 2021 20:49:28 +0000 (20:49 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Tue, 30 Nov 2021 20:52:13 +0000 (20:52 +0000)
commita8ac892bab446ac11f816edec53306256bad4de7
tree9c8cc72a2c815b0413a146dd04087b6b033574f3
parent8f6df489079dc9cf6f66b0e69b6994912495b1ba
Fix FATAL ServiceRep::putConnection exception: theBusyConns > 0 (#939)

    FATAL: check failed: theBusyConns > 0
        exception location: ServiceRep.cc(163) putConnection

Since master/v6 commit 2b6b1bc, a timeout on a ready-to-shovel
Squid-service ICAP connection was decrementing theBusyConns level one
extra time because Adaptation::Icap::Xaction::noteCommTimedout() started
calling both noteConnectionFailed() and closeConnection(). Depending on
the actual theBusyConns level, the extra decrement could result in FATAL
errors later, when putConnection() was called (for a different ICAP
transaction) with zero theBusyConns in an exception-unprotected context.

Throughout these changes, Xaction still counts the above timeouts as a
service failure. That is done by calling ServiceRep::noteFailure() from
Xaction::callException(), including in timeout cases described above.
src/adaptation/icap/ServiceRep.cc
src/adaptation/icap/Xaction.cc