[Bug 711635] Re: init: post-start can cause respawn to hang

Clint Byrum clint at fewbar.com
Mon Feb 20 01:55:29 UTC 2012

I spent some time on this today, and I think that upstart's handling of
respawn + post-start is probably making jobs harder than they need to

In the mysql case, we need to exit the mysqladmin ping loop if the
process goes into 'respawn', so that the process can in fact be
respawned... otherwise it waits. This also causes the usual respawn
limit to not be hit because we're respawning 1 time every 30 seconds. In
fact, just the lag of forking and running mysqladmin ping is enough to
prevent us from restarting 10 times in 5 seconds, which is the default

So IMO, upstart should have a way to respawn independent of post-start.
But that is a much bigger change and needs more thought. For jobs with a
post-start, they need to make sure the post-start is reactive to the
respawn status by exitting when it is detected, and considering this in
any respawn limits.

So, I'll be uploading a fix to precise's mysql-5.5 package which will
fail with 2 respawns in 5 seconds, and exits the mysqladmin loop if
status is respawn. This causes the job to report a failure to start if
things are truly broken, which is what we want. It will also cause
respawn to give up faster if mysqld exits, but I think that is fine
given that it is a large database daemon and probably isn't going to
respond well to the rapid respawning.

** Changed in: mysql-5.5 (Ubuntu)
       Status: Triaged => In Progress

** Changed in: mysql-5.5 (Ubuntu)
     Assignee: (unassigned) => Clint Byrum (clint-fewbar)

** Changed in: mysql-5.5 (Ubuntu)
   Importance: Low => High

** Changed in: mysql-5.1 (Ubuntu)
   Importance: Low => High

** Changed in: mysql-dfsg-5.1 (Ubuntu)
   Importance: Low => High

You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to mysql-5.1 in Ubuntu.

  init: post-start can cause respawn to hang

To manage notifications about this bug go to:

More information about the Ubuntu-server-bugs mailing list