From mboxrd@z Thu Jan 1 00:00:00 1970 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.6 required=5.0 tests=AWL,MSGID_FROM_MTA_HEADER, RP_MATCHES_RCVD,T_DKIM_INVALID shortcircuit=no autolearn=unavailable version=3.3.2 Path: news.gmane.org!not-for-mail From: Jamie Wilkinson Newsgroups: gmane.comp.lang.ruby.unicorn.general Subject: Re: Unicorn fails to restart gracefully on capistrano deploy Date: Thu, 9 Sep 2010 17:19:35 -0700 Message-ID: <94DA7535-598C-4C42-8D81-91D5A98183EF@tramchase.com> References: <162ABE91-E653-45BE-B611-AF6C2B37CC4B@efficiency20.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1284077992 31116 80.91.229.12 (10 Sep 2010 00:19:52 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 10 Sep 2010 00:19:52 +0000 (UTC) To: unicorn list , tech Original-X-From: mongrel-unicorn-bounces@rubyforge.org Fri Sep 10 02:19:50 2010 Return-path: Envelope-to: gclrug-mongrel-unicorn@m.gmane.org X-Original-To: mongrel-unicorn@rubyforge.org Delivered-To: mongrel-unicorn@rubyforge.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:content-type :mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; bh=dDR8ezhmZzaj53RJr259vCOjtjVcc7fh1pCo+BBwg8w=; b=J6VVfrMsFtrsUt1qLdSiJJSfEkqjYBicVPaPqYpBM7jMRcX66D7KX2Ay7BKHBNG8n/ dwbczO0p6mDz5jzSNTwiMJJxLb3RbBNYfo9wr7mfb9bGfsMTNUosy/boq4eMJhl9RCEW Xu9CIQoVen/dFtvKzxz9L1oliMm32W56Njef0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; b=i+P2MUizVJQgrVAQJP0bZ+rJ5KjysnI34CCM8nfaHx5gNgfct8A7cmmqBjlaMXIyi2 1C0t0ak25ThQfeAYeNeoSELaKmRiwkm8qCQobL7aymAY9MRrT4FiM9acSfXZnxWrlhxH I34JlQ2By7rOu35HrzrKCLE5rZLjeCun/FX7M= In-Reply-To: <162ABE91-E653-45BE-B611-AF6C2B37CC4B@efficiency20.com> X-Mailer: Apple Mail (2.1081) 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: , Original-Sender: mongrel-unicorn-bounces@rubyforge.org Errors-To: mongrel-unicorn-bounces@rubyforge.org Xref: news.gmane.org gmane.comp.lang.ruby.unicorn.general:701 Archived-At: Received: from rubyforge.org ([205.234.109.19]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OtrLJ-0004Or-31 for gclrug-mongrel-unicorn@m.gmane.org; Fri, 10 Sep 2010 02:19:49 +0200 Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 7CEF719782D4; Thu, 9 Sep 2010 20:19:48 -0400 (EDT) Received: from mail-pv0-f178.google.com (mail-pv0-f178.google.com [74.125.83.178]) by rubyforge.org (Postfix) with ESMTP id B4C5719782CD for ; Thu, 9 Sep 2010 20:19:40 -0400 (EDT) Received: by pvh1 with SMTP id 1so860897pvh.23 for ; Thu, 09 Sep 2010 17:19:40 -0700 (PDT) Received: by 10.114.66.20 with SMTP id o20mr89439waa.163.1284077978437; Thu, 09 Sep 2010 17:19:38 -0700 (PDT) Received: from [10.0.1.31] (173-13-169-18-sfba.hfc.comcastbusiness.net [173.13.169.18]) by mx.google.com with ESMTPS id 33sm3278135wad.6.2010.09.09.17.19.37 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 09 Sep 2010 17:19:37 -0700 (PDT) On Sep 9, 2010, at 4:28 PM, Eirik Dentz Sinclair wrote: > First off thanks very much for all the hard work on unicorn. Alas, we've encountered an issue where unicorn fails to spawn new workers that have loaded the incoming revision on a capistrano deploy. I'm not entirely sure the issue is due to unicorn as it appears that bundler was responsible for a similar issue in the past: http://github.com/carlhuda/bundler/issues/issue/259/#comment_180830 > > But presumably bundler has corrected that issue and any help in sorting out the issue would be greatly appreciated. > > [snip] > > The deployed versioned directory is 20100830230613 > The incoming versioned directory is 20100902192111 I think I may have run into a potentially related bundler+unicorn+capistrano issue just today! With bundler+unicorn the shell environment does not really get cleared between USR2 restarts/forkings, which was the cause of the aforementioned GitHub ticket... PATH/RUBYOPT would just get infinitely appended to by bundler, and unicorn is happy to let you do whatever with the environment The bug I found today cropped up while upgrading from rails 2.3.8 to rails 2.3.9 -- on deploy the new unicorn master would die with "hey you've already loaded rails 2.3.8!". Weird. Some quick debugging showed my BUNDLE_GEMFILE environment variable was referencing a Gemfile from a (very) old capistrano release.... I'm actively debugging it now. I'm also using preload_app=true which might have contributed. Eirik, can you confirm any similar "old release" weirdnesses by dumping the ENV in your unicorn.rb's before_exec / before_fork? STDERR.puts ENV.inspect _______________________________________________ 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