unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
From: Clifton King <cliftonk@gmail.com>
To: unicorn list <mongrel-unicorn@rubyforge.org>
Subject: Re: synchronous restart
Date: Tue, 31 Aug 2010 15:15:04 -0500	[thread overview]
Message-ID: <AANLkTikorRi-m0B-NT_4mzTm6M_ii3fA17TM9qe45G=T@mail.gmail.com> (raw)
In-Reply-To: <CC111CB2-3EBE-459D-81F7-71B273A4784F@tramchase.com>

Jamie,

Check to see that the new unicorn master process has a different PID
than the old one. You could have a script that sleeps for X seconds
and checks the PID after the deploy and if it matches the old one
alerts you with a tail of the stdout/stderr log files. I personally do
"ps aux | grep unicorn" a few times during the process if there are
any changes being deployed I'm wary of.

Clifton

On Tue, Aug 31, 2010 at 3:08 PM, Jamie Wilkinson <jamie@tramchase.com> wrote:
> On Aug 31, 2010, at 12:08 PM, Clifton King wrote:
>
>> If the new master process
>> fails at booting, you can tail the unicorn.stdout/err.log files to see
>> why.
>
>
> I should clarify... the above is exactly what I'm trying to avoid. i.e. how do you know if your new master failed to boot unless you are actively tailing the logs?
>
> It is extremely infrequent that our unicorns fail to start, but when it does we sometimes don't notice for quite some time. Our unicorns also restart so quickly that it is not an issue to do the restarts synchronously during deployment and trade speed for peace of mind
>
> I will probably just replace our basic `kill -USR2` with a small script that sends the signal and doesn't exit until the pidfile handover is complete. I'll be sure to share my results in case anyone else might find this useful.
>
>
> -jamie
>
> http://jamiedubs.com | http://fffff.at
>
>> On Tue, Aug 31, 2010 at 1:30 PM, Jamie Wilkinson <jamie@tramchase.com> wrote:
>>> Has anyone tried to synchronously restart their unicorns, to ensure that things restart OK?
>>>
>>> I imagine I could write a script that sent USR2 and then watched the log for a successful before exiting, but I dream there is something more MAGICAL
>>>
>>>
>>> Yours in mythical web servers,
>>>
>>> -jamie
>>>
>>> _______________________________________________
>>> Unicorn mailing list - mongrel-unicorn@rubyforge.org
>>> http://rubyforge.org/mailman/listinfo/mongrel-unicorn
>>> Do not quote signatures (like this one) or top post when replying
>>>
>> _______________________________________________
>> Unicorn mailing list - mongrel-unicorn@rubyforge.org
>> http://rubyforge.org/mailman/listinfo/mongrel-unicorn
>> Do not quote signatures (like this one) or top post when replying
>
> _______________________________________________
> Unicorn mailing list - mongrel-unicorn@rubyforge.org
> http://rubyforge.org/mailman/listinfo/mongrel-unicorn
> Do not quote signatures (like this one) or top post when replying
>
_______________________________________________
Unicorn mailing list - mongrel-unicorn@rubyforge.org
http://rubyforge.org/mailman/listinfo/mongrel-unicorn
Do not quote signatures (like this one) or top post when replying


  reply	other threads:[~2010-08-31 20:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-31 18:30 synchronous restart Jamie Wilkinson
2010-08-31 19:08 ` Clifton King
2010-08-31 20:08   ` Jamie Wilkinson
2010-08-31 20:15     ` Clifton King [this message]
2010-08-31 20:29     ` Stephen Eley
2010-08-31 23:59       ` Lawrence Pit
2010-08-31 20:58   ` Stephen Eley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://yhbt.net/unicorn/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='AANLkTikorRi-m0B-NT_4mzTm6M_ii3fA17TM9qe45G=T@mail.gmail.com' \
    --to=cliftonk@gmail.com \
    --cc=mongrel-unicorn@rubyforge.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhbt.net/unicorn.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).