jonty.wareing at gmail.com
Fri Oct 12 11:44:13 UTC 2007
Amusingly, I suddenly needed graceful timeout functionality as of this
morning, so cooked up a quick patch to add it.
It's a small five liner and is attached - just specify the number of
seconds when issuing the graceful shutdown command.
On 10/10/07, Mark Smith <smitty at gmail.com> wrote:
> > Will Perlbal unbind from it's listening ports immediately upon getting
> > the 'shutdown graceful' command? If not, then would I need to somehow
> > monitor the old instance once I issue the command and then startup a new
> > Perlbal once the old one is completely finished?
> > If I were to write a Perlbal psuedo-init script, would the following
> > logic work?
> > - get Perlbal PID (from file?)
> > - connect to running Perlbal via telnet
> > - issue 'shutdown graceful' command
> > - wait until telnet socket is closed (indicating Perlbal has terminated)
> > - double check that Perlbal PID is no more ( i.e. kill -0 $PID)
> > - start a new Perlbal
> > - connect to new Perlbal via telnet to confirm it's running
> This is the flow I used on LJ:
> * connect to existing Perlbal management port
> * issue 'shutdown graceful'
> * start new Perlbal up immediately
> * wait 10 seconds (usually I'd check the new Perlbal to make sure it's
> getting traffic here)
> * if the socket from the first step is still open, issue 'shutdown' command
> If the socket goes away, then Perlbal shut itself down all of the way. If
> not, then the final 'shutdown' forces an immediate termination. You can do
> the work with the pid to ensure it's gone away if you want, that'd certainly
> be safer.
> But yes, Perlbal immediately unbinds all listening sockets when you issue a
> graceful shutdown command.
> As an aside, Perlbal should have a 'shutdown graceful [timeout]' option
> where you can specify how many seconds to sit around for, then force a hard
> exit. Hmm...
> Mark Smith / xb95
> smitty at gmail.com
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 774 bytes
Desc: not available
Url : http://lists.danga.com/pipermail/perlbal/attachments/20071012/0bb5bffb/perlbal_graceful_timeout_patch.bin
More information about the perlbal