~rousskov/squid/3p1-rock

Viewing all changes in revision 9623.

  • Committer: Alex Rousskov
  • Date: 2010-09-12 22:33:45 UTC
  • Revision ID: rousskov@measurement-factory.com-20100912223345-n56rntkk7vhfxetv
Handle ICAP persistent connection races better.

When an ICAP transaction loses a persistent connection race with an ICAP
server (i.e., Squid sends the ICAP request on a persistent connection just
closed by the ICAP server), the transaction throws and the exception is
treated as a regular error. Even though the transaction may be retried, the
negative side-effects may include ICAP service suspension due to transaction
failures.

This patch logs ICAP transactions that fail due to pconn races with
ERR_ICAP_RACE status and does _not_ blame the ICAP service for the failure.

The following problem was exposed by the pconn races but its fix is
useful in other scopes as well:

When the ICAP connection times out, we now close the connection before
throwing because an exception may be bypassed, and we will throw again (during
peaceful bypass) if Comm tells us that the connection is ready after we timed
out (yes, that can happen because Comm timeouts do not auto-close the
connection).

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: