]> git.ipfire.org Git - thirdparty/squid.git/commit
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)
committerAmos Jeffries <yadij@users.noreply.github.com>
Thu, 19 Mar 2020 10:49:01 +0000 (23:49 +1300)
commit1af789e07f9a42a26ed28e4a90583f67649b5d36
tree55c585df619753d8585ef96712ee6f3af8edfd71
parentdd41ef460a71857ff8a9e6fc3bc9d41a7a234ffd
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