Re: [squid-users] How to diagnose race condition?

From: George Herbert <george.herbert_at_gmail.com>
Date: Mon, 25 Apr 2011 14:59:01 -0700

On Mon, Apr 25, 2011 at 2:41 PM, Steve Snyder <swsnyder_at_snydernet.net> wrote:
> I just upgraded from CentOS 5.5 to CentOS 5.6, while running Squid v3.1.12.1 in both environments, and somehow created a race condition in the process.  Besides updating the 200+ software packages that are the difference between 5.5 and 5.6, I configured and enabled DNSSEC on my nameserver.
>
> What I see now is that Squid started at boot time uses 100% CPU, with no traffic at all, and will stay that way seemingly forever.  If I shut down Squid and restart it, all is well.  So: Squid started at boot time = bad, Squid started post-boot = good.  There is nothing unusual in either the system or Squid logs to suggest what the problem is.
>
> Can anyone suggest how to diagnose what Squid is doing/waiting for?
>
> Thanks.

Not precisely sure, however in general...

If you have a viable console at the time, you can trace the process
activity and see what it's waiting on (what file, network port, etc).
Figure out what process ID squid is, and then strace -p <pid>.

If that's not working, modify the init start script temporarily.
Where it normally runs squid, modify it to log instead:

strace -o/tmp/squid-strace <squid binary name...>

Quick and dirty solution to try first - move its init script to
S99squid from whatever number it is now. And if you're starting it at
runlevel 2, move it to the end of runlevel 3... More generally, look
at what init scripts got moved around from 5.5 to 5.6....

-- 
-george william herbert
george.herbert_at_gmail.com
Received on Mon Apr 25 2011 - 21:59:09 MDT

This archive was generated by hypermail 2.2.0 : Tue Apr 26 2011 - 12:00:03 MDT