How to automate the restarting of Unicorn?

Pai-Hung Chen paihungchen at hotmail.com
Mon Oct 10 16:34:19 EDT 2011


> On 10/10/2011 08:04 AM, Devin Ben-Hur wrote:

> >> My question is: By the time the "before_exec" hook is executed, is it
> >> guaranteed that unicorn.pid.oldbin ahas lready created (otherwise we
> >> have a racing condition here)? Or is there a better way to achieve
> >> what I want?
> > I'm not 100% positive, but about 98% -- yes, you can count on the fact that
the *.oldbin file will exist on
> > disk before the before_exec block is executed. Eric can confirm this, but
I've never had a problem with it...
> No need to rely on authority, just read the source: 
> https://github.com/defunkt/unicorn/blob/master/lib/unicorn/http_server.rb

Thanks for the pointer. The current source code clearly shows before_exec is
called after the .oldbin file is created. I'd like to know if this is considered
an "invariant" going forward. Could someone in the "authority" help?

Thanks,
Pai-Hung





More information about the mongrel-unicorn mailing list