]> git.ipfire.org Git - thirdparty/squid.git/commit - src/Transients.cc
Do not stall if xactions overwrite a recently active cache entry (#516)
authorEduard Bagdasaryan <eduard.bagdasaryan@measurement-factory.com>
Wed, 15 Jan 2020 15:57:14 +0000 (15:57 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Thu, 16 Jan 2020 09:38:20 +0000 (09:38 +0000)
commitd1d3b4dce2e25663aa0565dc630b2c97aa199065
tree4a8cb55321d9edc1e343bec1843d2316d6de36cb
parent755eac9438614e4acadae7d7d6dc727ecdc40865
Do not stall if xactions overwrite a recently active cache entry (#516)

After the last transaction that cached or read the reply R1 ended, its
Transients entry T1 was not freed. Subsequent requests (with different
public keys) could occupy the same shared memory and rock slots (purging
unlocked R1), preventing Squid from attaching a T1-derived StoreEntry to
the cache. Another request for R1 would receive T1 and stall because its
worker W1 kept waiting for a notification from another worker W2,
incorrectly assuming that W2 exists and is going to fetch R1 for W1.
That request was aborted after a timeout.

A Transients entry represents active transaction(s). Broadcasts stop
when there are no transactions to inform. We must remove idle (i.e.
unlocked) Transients entries to avoid feeding new transactions with
stale info. We now do that when unlocking a Transients entry and also
double check that a found unattached Transients entry has a writer.
src/Transients.cc
src/Transients.h
src/ipc/ReadWriteLock.cc
src/ipc/ReadWriteLock.h
src/ipc/StoreMap.cc
src/ipc/StoreMap.h
src/store/Controller.cc