File SQUID-2016_10_a.patch of Package squid.3917
------------------------------------------------------------
author: Eduard Bagdasaryan <eduard.bagdasaryan@measurement-factory.com>
branch nick: 3.5
timestamp: Fri 2016-12-16 17:27:10 +1300
message:
Do not share private responses with collapsed client(s).
This excessive sharing problem with collapsed forwarding code has
several layers. In most cases, the core CF code does not share
uncachable or private response with collapsed clients because of the
refreshCheckHTTP() check. However, some responses might not be subject
to that (or equivalent) check. More importantly, collapsed revalidation
code does not check its responses at all and, hence, easily shares
private responses.
This short-term fix incorrectly assumes that an entry may become private
(KEY_PRIVATE) only when it cannot be shared among multiple clients
(e.g., because of a Cache-Control:private response header). However,
there are a few other cases when an entry becomes private. One of them
is a DISK_NO_SPACE_LEFT error inside storeSwapOutFileClosed() where
StoreEntry::releaseRequest() sets KEY_PRIVATE for a sharable entry [that
may still be perfectly preserved in the memory cache]. Consequently, the
short-term fix reduces CF effectiveness. The extent of this reduction is
probably environment-dependent.
NOTE: this patch has been modified for squid-3.5.0.1 to 3.5.22
------------------------------------------------------------
=== modified file 'src/client_side_reply.cc'
--- src/client_side_reply.cc 2016-12-15 10:33:57 +0000
+++ src/client_side_reply.cc 2016-12-16 04:27:10 +0000
@@ -518,6 +527,16 @@
return;
}
+ // The previously identified hit suddenly became unsharable!
+ // This is common for collapsed forwarding slaves but might also
+ // happen to regular hits because we are called asynchronously.
+ if (EBIT_TEST(e->flags, KEY_PRIVATE)) {
+ debugs(88, 3, "unsharable " << *e << ". MISS");
+ http->logType = LOG_TCP_MISS;
+ processMiss();
+ return;
+ }
+
if (result.length == 0) {
debugs(88, 5, "store IO buffer has no content. MISS");
/* the store couldn't get enough data from the file for us to id the