]> git.ipfire.org Git - thirdparty/squid.git/commit
Bug 5329: cbdata.cc:276 "c->locks > 0" assertion on reconfigure (#1625)
authorEduard Bagdasaryan <eduard.bagdasaryan@measurement-factory.com>
Mon, 25 Dec 2023 02:20:19 +0000 (02:20 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Mon, 25 Dec 2023 02:20:25 +0000 (02:20 +0000)
commit4657405c4afd8d7125f747b5351f60844815af09
tree68c10b6bb72f79182adc5b0e551238f031a93f31
parentbe4bca3da26367e309e8a0010e91b14b2df07b9b
Bug 5329: cbdata.cc:276 "c->locks > 0" assertion on reconfigure (#1625)

Recent commit 0f78379 correctly removed an excessive cbdata lock of a
CachePeer::digest object in peerDigestCreate() but accidentally lost
another digest lock while inlining peerDigestCreate(). The resulting
excessive unlocking triggered reconfiguration assertions.

This change restores the lost lock as a short-term fix.

Long-term, CachePeer code should be fixed to become an exclusive[^1]
PeerDigest owner (i.e. creating and deleting its cbdata-protected digest
object without locking, unlocking, or checking locks). That improvement
is already in the works, but it requires significant code refactoring.

[^1]: Shared PeerDigest ownership (i.e. reference counting instead of
explicit delete and cbdata) does not work well in this context due to
circular references.
src/cache_cf.cc