[Mongrel] OHHHHHHHHHHHH!!!! Re: [ANN] Another mongrel_cluster prerelease 22.214.171.124
Zed A. Shaw
zedshaw at zedshaw.com
Thu Apr 12 17:20:25 EDT 2007
On Thu, 12 Apr 2007 11:52:26 -0700
"Michael A. Schoen" <schoenm at earthlink.net> wrote:
> Zed A. Shaw wrote:
> > I think I'm going to say, no, you don't get this in mongrel_cluster.
> > When we had it there were way too many problems because how Rails does
> > this kind of soft restart isn't very clear. It's basically a bunch of
> > black magic ruby that reloads all the stuff like in debug mode. That
> Am I misreading the code? I'm not talking about the HUP/reload stuff.
> I'm talking about the plain old regular Mongrel restart, which, from
> what I can tell, is a regular stop, with the restart flag set to true,
> such that it starts right back up again. No reloading of any Rails magic.
Ok, ok, ok, NOW we get it. The problem was that mongrel_cluster was
calling start/stop on the Mongrel because of issues with the capistrano
symlinks from back in the day. Now what we'll do is the following
change to mongrel_cluster:
1) When you do cluster::restart it sends the mongrel processes a USR2
signal. This is the signal that tells mongrel to stop everything, wait
until that's done, then re-run the start command again.
*** NOTE: If you change your mongrel_cluster config you'll have
to use start/stop.
2) When you do cluster::stop it sends TERM to do the stop. THIS will
not wait, so if you're doing this and need to wait then use the
mongrel.log and ps manually.
3) When you do cluster::start, it will try to start. It's on you to
handle this manually.
Everyone with this problem currently can very simply do the following
when they need the super graceful USR2:
killall -USR2 mongrel_rails
That will usually work on most linux systems, people on other systems
can probably come up with their quick fix.
Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu
http://www.awprofessional.com/title/0321483502 -- The Mongrel Book
More information about the Mongrel-users