[squid-dev] [PATCH] Reduce crashes due to unexpected ClientHttpRequest termination.

Christos Tsantilas christos at chtsanti.net
Wed Jan 11 19:09:24 UTC 2017


On 11/01/2017 04:50 μμ, Amos Jeffries wrote:
> On 11/01/2017 10:55 p.m., Christos Tsantilas wrote:
>> We observed such problems on squid shutdown procedure and during regular
>> squid operation. Any clientStreams redesign should take care of such
>> problems.
>>
>> The underlying problem has been known since r13480: If a
>> ClientHttpRequest job ends without Http::Stream (and ConnStateData)
>> knowledge, then Squid is likely to segfault or assert.
>>
>> This patch does not resolve the underlying issue (a proper fix would
>> require architectural changes in a consensus-lacking area) but makes an
>> unexpected ClientHttpRequest job destruction less likely.
>>
>> BodyPipe and Adaptation-related exceptions are the major causes of
>> unexpected ClientHttpRequest job destruction. This patch handles them by
>> closing the client connection. Connection closure should trigger an
>> orderly top-down cleanup, including Http::Stream, ConnStateData, and
>> ClientHttpRequest destruction.
>>
>> If there is no connection to close, then the exception is essentially
>> ignored with a level-1 error message disclosing the problem. The side
>> effects of ignoring such exceptions are unknown, but without a client
>> connection, it is our hope that they would be relatively benign.
>>
>> This is a Measurement Factory project
>>
>
> +1. Looks like a reasonable temporary fix. Thank you.

The  t5 patch which has minor fixes over the posted patch applied to 
squid-5 branch as r15004.

The same patch apply as is to squid-4 branch.
I am also attaching the patch for squid-3.5


>
> Amos

-------------- next part --------------
A non-text attachment was scrubbed...
Name: SQUID-255-multiple-assertions-during-shutdown-squid-3.5-t5.patch
Type: text/x-patch
Size: 4210 bytes
Desc: not available
URL: <http://lists.squid-cache.org/pipermail/squid-dev/attachments/20170111/af7047a8/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SQUID-255-multiple-assertions-during-shutdown-t5.patch
Type: text/x-patch
Size: 5011 bytes
Desc: not available
URL: <http://lists.squid-cache.org/pipermail/squid-dev/attachments/20170111/af7047a8/attachment-0003.bin>


More information about the squid-dev mailing list