[Varnish] #622: restart of varnishd sometimes fails on busy server

Varnish varnish-bugs at projects.linpro.no
Wed Jan 20 15:57:49 CET 2010


#622: restart of varnishd sometimes fails on busy server
----------------------+-----------------------------------------------------
 Reporter:  nicholas  |        Type:  defect
   Status:  new       |    Priority:  normal
Milestone:            |   Component:  build 
  Version:  trunk     |    Severity:  normal
 Keywords:            |  
----------------------+-----------------------------------------------------
 Sometimes we unfortunately need to restart varnishd.

 Running redhat and on a busy server, the normal stop/start routines
 doesn't always succeed.
 /etc/init.d/varnish restart says OK twice, but no varnish is running
 afterwoods. This of course only happens sometimes.

 Our theory is:
 stop() uses killproc -p $pidfile $prog, which in turn sends SIGTERM to pid
 of mother-process. Mother-process goes away nicely, but children linger on
 trying to finnish their work. When the start routine does daemon --pidfile
 $pidfile  $exec -P $pidfile "$DAEMON_OPTS" - the mother-process starts
 successful, but the port in use is still busy which children finnishing
 their work, so the new child fails to bind to port. The mother-process
 succeds enough for the start script to say OK though, so if you don't
 watch out it will go unnoticed by the sysadmin until nagios starts making
 noise. This is probably logged in syslog, but I forgot to save.

 If possible, we would like to see this fixed in varnishd, and not by
 making spesial start/stop routines in redhat.

 Any way to make restart smoother, without breaking too many http sessions
 or introducing unnecessary sleeps?

 Nicholas

-- 
Ticket URL: <http://varnish.projects.linpro.no/ticket/622>
Varnish <http://varnish.projects.linpro.no/>
The Varnish HTTP Accelerator


More information about the varnish-bugs mailing list