[Mongrel] Cluster restart leaving orphaned processes?
luislavena at gmail.com
Thu Dec 7 16:36:05 EST 2006
On 12/7/06, Ezra Zygmuntowicz <ezmobius at gmail.com> wrote:
> On Dec 7, 2006, at 12:44 PM, Zed A. Shaw wrote:
> > On Thu, 7 Dec 2006 12:43:02 -0500
> > cleaner416 <cleaner416 at gmail.com> wrote:
> > <snip>
> >> My only question is this: when I run mongrel_rails cluster::restart
> >> or mongrel_rails cluster::stop/start the old processes do not get
> >> killed off and I have to do it manually. I've noticed this on 3
> >> boxes, all running FC5 with user/group mongrel/mongrel. Any ideas?
> > There is kind of a dumb race condition I've gotta fix this week
> > where if you stop a mongrel process, but mongrel needs to wait on
> > some threads to finish, and then start a new one, all hell breaks
> > loose.
> > Check if this is the case by doing this:
> > 1) Tail the mongrel.log in a window off to the side.
> > 2) Start some requests or something that's common usage.
> > 3) Stop mongrel and look for log messages saying that process is
> > waiting on threads to finish.
> > 4) Right away start a new mongrel to replace this one. The .pid
> > file gets wiped out by this, and since the previous process is
> > waiting, the new process can't bind.
> > 5) Once the original process dies you'll be in the situation you've
> > got.
> > See if that's the problem. If it is then hang on as I'm beefing up
> > the start/stop logic to be a bit smarter about this.
> Hey Zed-
> I have been seeing this a lot when deploying apps from capistrano.
> It would be awesome to get it fixed in mongrel. What I have been
> doing for now is using gentoo's init.d script options so it will
> invoke the stop command and wait for 15 seconds, if mongrel doesn't
> go down by then it issues a kill -9 and then starts things up again.
On similar topic, but different platform (win32). I have been doing
the same, and changed mongrel_service to perform in the same way.
> ... I'd love to see mongrel stop be a bit
> more robust though for sure.
How do you think we should fix this? how will be the step by step
needed by mongrel to perform when restarting (mongrel and cluster).
Leaders are made, they are not born. They are made by hard effort,
which is the price which all of us must pay to achieve any goal that
More information about the Mongrel-users