From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS14383 205.234.109.0/24 X-Spam-Status: No, score=0.5 required=5.0 tests=FORGED_HOTMAIL_RCVD2, FREEMAIL_FROM,RP_MATCHES_RCVD shortcircuit=no autolearn=no version=3.3.2 X-Original-To: archivist@yhbt.net Delivered-To: archivist@dcvr.yhbt.net Received: from rubyforge.org (rubyforge.org [205.234.109.19]) by dcvr.yhbt.net (Postfix) with ESMTP id 6E1261F4CB for ; Mon, 10 Oct 2011 20:46:49 +0000 (UTC) Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id E04E21678366; Mon, 10 Oct 2011 16:46:48 -0400 (EDT) X-Original-To: mongrel-unicorn@rubyforge.org Delivered-To: mongrel-unicorn@rubyforge.org Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by rubyforge.org (Postfix) with ESMTP id 12E35185837B for ; Mon, 10 Oct 2011 16:40:13 -0400 (EDT) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1RDMdr-00045q-Ta for mongrel-unicorn@rubyforge.org; Mon, 10 Oct 2011 22:40:08 +0200 Received: from ip68-5-109-253.oc.oc.cox.net ([68.5.109.253]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 10 Oct 2011 22:40:07 +0200 Received: from paihungchen by ip68-5-109-253.oc.oc.cox.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 10 Oct 2011 22:40:07 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: mongrel-unicorn@rubyforge.org From: Pai-Hung Chen Subject: Re: How to automate the restarting of Unicorn? Date: Mon, 10 Oct 2011 20:34:19 +0000 (UTC) Message-ID: References: <4E928ADD.8040900@whitepages.com> Mime-Version: 1.0 X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 68.5.109.253 (Mozilla/5.0 (X11; Linux i686; rv:7.0.1) Gecko/20100101 Firefox/7.0.1) X-BeenThere: mongrel-unicorn@rubyforge.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: mongrel-unicorn-bounces@rubyforge.org Errors-To: mongrel-unicorn-bounces@rubyforge.org > 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 _______________________________________________ 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