From e71477f3a6f2cda3c217e12b1834d2ab1d05ffc1 Mon Sep 17 00:00:00 2001 From: rousskov <> Date: Tue, 8 May 2007 22:16:42 +0000 Subject: [PATCH] If a consumer leaves without consuming anything, do not tell the producer that the consumer has aborted. This change increases the risk that, due to bugs, no [other] consumer will come and the producer will get stuck waiting for the buffer space. However, this risk should be mitigated by timeouts because no amount of code can ensure eventual consumer presence if producer and consumer are asynchronous. This change was needed to support ICAP transaction retries. When a transaction aborts due to pconn race conditions, without consuming body buffer, the second transaction will start from scratch and become the body consumer. --- src/BodyPipe.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BodyPipe.cc b/src/BodyPipe.cc index fa1151a9c9..9293bed363 100644 --- a/src/BodyPipe.cc +++ b/src/BodyPipe.cc @@ -145,7 +145,7 @@ BodyPipe::clearConsumer() { if (theConsumer) { debugs(91,7, HERE << "clearing consumer" << status()); theConsumer = NULL; - if (!exhausted()) + if (consumedSize() && !exhausted()) AsyncCall(91,5, this, BodyPipe::tellBodyConsumerAborted); } } -- 2.47.3