[squid-dev] [PATCH] No reconfiguration during shutdown

Alex Rousskov rousskov at measurement-factory.com
Mon Oct 26 16:00:13 UTC 2015


Hello,

    To avoid crashes, prohibit pointless reconfiguration during shutdown.

Also consolidated and polished signal action handling code:

1. For any executed action X, clear do_X at the beginning of action X
   code because once we start X, we should accept/queue more X
   requests (or inform the admin if we reject them).

2. Delay any action X requested during startup or reconfiguration
   because the latter two actions modify global state that X depends
   on. Inform the admin that the requested action is being delayed.

3. Cancel any action X requested during shutdown. We cannot run X
   during shutdown because shutdown modifies global state that X
   depends on, and we never come back from shutdown so there is no
   point in delaying X. Inform the admin that the requested action is
   canceled.

Repeated failed attempts to fix crashes related to various overlapping
signal actions confirm that this code is a lot trickier than it looks.
This change introduces a more systematic/comprehensive approach to
resolving associated conflicts compared to previous ad hoc attempts.

For example, there were several changes related to bug 3574 (trunk
r14354), but trunk Squid still crashes if SIGHUP is received at the
"wrong" time. I hope this fix will kill the remaining similar bugs or at
least make future fixes easier.

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


One possible future work is to split shutdown into two states:

* scheduled (waiting for timeout to expire; may not affect some of the
  signal actions) and
* in-progress (blocks out all other actions).

Currently, the two states are merged into one in trunk code (there is
only one shutting_down global). This fix does not attempt to address
that deficiency. Factory does not plan to work on this in the
foreseeable future. Please feel free to solve this problem!


Amos, I have also attached a "bag10s" patch that may work better for the
v3.5 branch should you decide to apply this fix to v3.5 as well.


Thank you,

Alex.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SQUID-116-no-reconfig-during-shutdown-t8.patch
Type: text/x-diff
Size: 9175 bytes
Desc: not available
URL: <http://lists.squid-cache.org/pipermail/squid-dev/attachments/20151026/0149c28d/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SQUID-116-no-reconfig-during-shutdown-bag10s-t8.patch
Type: text/x-diff
Size: 7438 bytes
Desc: not available
URL: <http://lists.squid-cache.org/pipermail/squid-dev/attachments/20151026/0149c28d/attachment-0001.patch>


More information about the squid-dev mailing list