From: DrDaveD <2129743+DrDaveD@users.noreply.github.com> Date: Fri, 26 Jun 2020 12:09:19 +0000 (-0500) Subject: Bug 5051: Some collapsed revalidation responses never expire (#683) X-Git-Tag: SQUID_4_13~10 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=feb14788d0cf85dfb2e542d6e327121d5e19ba9b;p=thirdparty%2Fsquid.git Bug 5051: Some collapsed revalidation responses never expire (#683) * clear collapsed revalidation on a negative response * fixup: Reduce chances of forgetting to call clearPublicKeyScope() ... in other/future sendClientUpstreamResponse() cases. TODO: 1. Handle sendClientOldEntry() cases. We probably do not want future collapsed revalidation clients to accidentally collapse on the new entry that was rejected by this code. After all, such collapsing is exactly what caused bug 5051 AFAICT! 2. Consider cases where a collapsed revalidation did not reach handleIMSReply(). For example, imagine a client that created the collapsed revalidation entry and then disconnected or died. How to protect other clients on hitting that essentially stale entry forever, keeping bug 5051 alive? Co-authored-by: Alex Rousskov --- diff --git a/src/client_side_reply.cc b/src/client_side_reply.cc index b397d59d9f..ce939350aa 100644 --- a/src/client_side_reply.cc +++ b/src/client_side_reply.cc @@ -367,6 +367,10 @@ clientReplyContext::sendClientUpstreamResponse() { StoreIOBuffer tempresult; removeStoreReference(&old_sc, &old_entry); + + if (collapsedRevalidation) + http->storeEntry()->clearPublicKeyScope(); + /* here the data to send is the data we just received */ tempBuffer.offset = 0; old_reqsize = 0; @@ -480,10 +484,6 @@ clientReplyContext::handleIMSReply(StoreIOBuffer result) http->logType = LOG_TCP_REFRESH_MODIFIED; debugs(88, 3, "origin replied " << status << ", replacing existing entry and forwarding to client"); - - if (collapsedRevalidation) - http->storeEntry()->clearPublicKeyScope(); - sendClientUpstreamResponse(); } }