]> git.ipfire.org Git - thirdparty/squid.git/commit
Bug 3462: Delay Pools and ICAP
authorJulien Pinon <jpinon@olfeo.com>
Thu, 21 Jun 2012 00:39:01 +0000 (18:39 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Thu, 21 Jun 2012 00:39:01 +0000 (18:39 -0600)
commit4c675a57e90c7cbc966ffeb3740fb3982ff8d40f
treed48c0c865dfa72287bf6a490f8d0b835edce7dbf
parente84f94583cb85734a5d219fbd5dc3a68cd86b315
Bug 3462: Delay Pools and ICAP

Allow StoreEntry::bytesWanted() API to ignore delay pools. Use that
feature when shoveling adapted response body from ICAP/eCAP BodyPipe
into Store.

If we do not ignore delay pools in
ServerStateData::handleMoreAdaptedBodyAvailable() context, and our pool
quota is exhausted, we will stop reading from the adaptation BodyPipe,
but there is no code/API to notify a BodyPipe reader when the quota
becomes available again.  With no reads from the pipe, the ICAP service
stops sending more adapted body data and possibly stops reading the
virgin body data from Squid, resulting in a stuck ICAP RESPMOD and the
master HTTP transaction.

We do need to call StoreEntry::bytesWanted() in this context because
otherwise Squid may run out of RAM (Squid bug #2619). The fix for that
problem inadvertently created this bug when delay pools were enabled.

Long-term, a "kick BodyPipe consumer when there is quota" code should be
added, and delay pools should be enabled for ICAP responses, but with
enough knobs for admins to disable ICAP pooling where needed. Most ICAP
environments will probably want to disable bandwidth controls because
ICAP service traffic is usually "local".

Removed StoreEntry::bytesWanted() TRY_FWD_HDR_WAIT guard that disabled
delay pool application until the final HTTP response headers are
received (HttpStateData::haveParsedReplyHeaders() is called). Nobody
could fully explain why that condition was really needed (and we
obviously want to limit bandwidth consumption at all response processing
stages, in general). The now-removed guard was bypassing delay pool
checks for virgin HTTP response (until the ICAP server responded with
adapted headers), causing bandwidth overuse.

Possibly fixes or helps with Squid bug #2606 as well.
src/MemObject.cc
src/MemObject.h
src/Server.cc
src/Store.h
src/store.cc
src/tests/stub_MemObject.cc
src/tests/stub_store.cc