]> git.ipfire.org Git - thirdparty/squid.git/commit
pconn_lifetime robustness fixes
authorChristos Tsantilas <chtsanti@users.sourceforge.net>
Tue, 28 Apr 2015 09:55:08 +0000 (12:55 +0300)
committerChristos Tsantilas <chtsanti@users.sourceforge.net>
Tue, 28 Apr 2015 09:55:08 +0000 (12:55 +0300)
commit045ccffec43db8471ca2f593da89340a63ea888c
tree63847ad39431aebb191adf2b7a30d56f88e57d97
parent40a2e1d0f33b1c3493f603eeeba134e8708077d1
pconn_lifetime robustness fixes

This patch changes pconn_lifetime (r13780) to abort only really idle
persistent connections (when they timeout). It removes some "extra" features
(added to pconn_lifetime during the feature review) because they break things
when aggressive timeouts is combined with picky clients. Specifically,

1. Squid closed connections with partially received requests when they
   reached pconn_lifetime limit. We should only close _idle_ connections.

2. When connecting to Squid without sending anything for longer than
   pconn_lifetime, the connection hangs if the request is sent after the
   waiting period.

3. The connection also hangs if the initial request is starting to be
   transmitted but then there is a longer pause before the request is
   completed.

Most of the above problems are easy to trigger only when using very aggressive
pconn_lifetime settings that the feature was not designed for, but they still
can be considered bugs from admins point of view. Fixes:

* Do not stop reading a partially received request when we are timing out,
  to avoid aborting that request.

* Do not set keepalive flag based on the pconn_lifetime timeout. We cannot
  predict whether some new request data is going to be read (and reset the
  idle timeout clock) before our Connection:close response is sent back.

HTTP clients are supposed to recover from such races, but some apparently
do not, especially if it is their first request on the connection.

This is a Measurement Factory project.
src/client_side.cc
src/client_side_reply.cc