[PATCH] Bug 2680: ** helper errors after -k rotate

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Sat, 11 Jul 2009 20:08:32 +1200

http://www.squid-cache.org/bugs/show_bug.cgi?id=2680

I've tracked this one down to the helper shutdown being async and used
from mainRotate() which is a sync operation.

We are probably hitting the same issue on reconfigure and shutdown.

It's most visible in rotate because Squid is intended to keep running
with a hot-swap of its logs. Previously the sequence was causing two
full sets of helpers to be started, and a period of overlap before the
async closure of the old set happened.

But now that we are enforcing the number of helpers started to prevent
memory bloat the overlap prevents the new set from starting at all.

The safety checks in helper itself which prevent live restart attempts
are tuned to only do so on incremental helper deaths, not to wholesale
100% loss of helpers.

Our options are:
  1 don't shutdown helpers on rotate (this ha been another open bug)
  2 make helpers code extremely aggressive to keep helpers running (at
cost of being able to detect failures)
  3 make mainRotate async

(2) and (3) wil need to be done eventually, however as far as I can see
there are only cons involved with keeping the status-quo of current
rotate behavior:
  * extra work for Squid restarting stuff.
  * stateful helpers may be dropped mid-action leading to client errors.
  (from a simple log rotation!!)
  * longer time for the operation to complete back to a stable request
processing state.

Attached is a patch for those worst affected which removes the helpers
from rotate sequence (option 1). I've checked and the only ways I can
see at this point for helper to do any logging is via syslog or stderr
relay back to Squid.

Is there something I've missed that means some helpers MUST be restarted
on rotate?

Amos

-- 
Please be using
   Current Stable Squid 2.7.STABLE6 or 3.0.STABLE16
   Current Beta Squid 3.1.0.9

Received on Sat Jul 11 2009 - 08:08:41 MDT

This archive was generated by hypermail 2.2.0 : Thu Jul 16 2009 - 12:00:05 MDT