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: AS33070 50.56.128.0/17 X-Spam-Status: No, score=1.7 required=3.0 tests=AWL,HK_RANDOM_FROM, MSGID_FROM_MTA_HEADER,RDNS_NONE shortcircuit=no autolearn=no version=3.3.2 Path: news.gmane.org!not-for-mail From: Eric Wong Newsgroups: gmane.comp.lang.ruby.rainbows.general Subject: Re: BUG: HUP signal reloads config, but gives RuntimeError - Application has already initialized Date: Wed, 4 Sep 2013 17:21:49 +0000 Message-ID: <20130904172149.GA2713@dcvr.yhbt.net> References: <410FB453-44E7-4F7D-BC29-4AA36A0C412C@teknobingo.no> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1378315398 29715 80.91.229.3 (4 Sep 2013 17:23:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 4 Sep 2013 17:23:18 +0000 (UTC) To: Rainbows! list Original-X-From: rainbows-talk-bounces-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Wed Sep 04 19:23:22 2013 Return-path: Envelope-to: gclrrg-rainbows-talk@m.gmane.org X-Original-To: rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Delivered-To: rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Content-Disposition: inline In-Reply-To: <410FB453-44E7-4F7D-BC29-4AA36A0C412C-rCoryE6l9AakgyF2CNKXmw@public.gmane.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: rainbows-talk-bounces-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Errors-To: rainbows-talk-bounces-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org X-Broken-Reverse-DNS: no host name found for IP address 50.56.192.79 Xref: news.gmane.org gmane.comp.lang.ruby.rainbows.general:531 Archived-At: Received: from [50.56.192.79] (helo=rubyforge.org) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VHGnZ-0005TF-GW for gclrrg-rainbows-talk@m.gmane.org; Wed, 04 Sep 2013 19:23:21 +0200 Received: from localhost.localdomain (localhost [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 8E9C92E18C; Wed, 4 Sep 2013 17:23:21 +0000 (UTC) Received: from dcvr.yhbt.net (dcvr.yhbt.net [64.71.152.64]) by rubyforge.org (Postfix) with ESMTP id D849C2E183 for ; Wed, 4 Sep 2013 17:21:51 +0000 (UTC) Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id C920F1F6BD; Wed, 4 Sep 2013 17:21:49 +0000 (UTC) Patrick Hanevold wrote: > Why aren't you guys on github? Because people care whether or not a project is on GitHub or not, and that's a sign their exclusive features are leading to vendor lock-in. Avoiding lock-in is a big reason I'm involved in Free Software/Open Source in the first place. > environment.rb line 5 initializes the application. > I, [2013-09-04T13:53:52.023134 #7953] INFO -- : reloading config_file=/home/capistrano/sites/fargekladden/current/config/rainbows.rb > I, [2013-09-04T13:53:52.192878 #7953] INFO -- : Refreshing Gem list > E, [2013-09-04T13:53:52.193995 #7953] ERROR -- : error reloading config_file=/home/capistrano/sites/fargekladden/current/config/rainbows.rb: Application has been already initialized. (RuntimeError) You're using preload_app? This is an incompatible with SIGHUP but I failed to document it for Rainbows! (it's documented for unicorn). I've just pushed out the following: Subject: [PATCH] SIGNALS: document SIGHUP/preload_app incompatibility This was documented in the unicorn docs, but not Rainbows! (The major difference between unicorn and Rainbows! signal handling is the deferred handling of SIGUSR1 in unicorn vs the immediate handling in Rainbows!) --- SIGNALS | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/SIGNALS b/SIGNALS index 7b61172..b761ae5 100644 --- a/SIGNALS +++ b/SIGNALS @@ -10,6 +10,16 @@ between \Rainbows!, Unicorn and nginx. === Master Process * HUP - reload config file, app, and gracefully restart all workers + If the "preload_app" directive is false (the default), then workers + will also pick up any application code changes when restarted. If + "preload_app" is true, then application code changes will have no + effect; USR2 + QUIT (see below) must be used to load newer code in + this case. When reloading the application, +Gem.refresh+ will + be called so updated code for your application can pick up newly + installed RubyGems. It is not recommended that you uninstall + libraries your application depends on while Rainbows! is running, + as respawned workers may enter a spawn loop when they fail to + load an uninstalled dependency. * INT/TERM - quick shutdown, kills all workers immediately -- Eric Wong _______________________________________________ Rainbows! mailing list - rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org http://rubyforge.org/mailman/listinfo/rainbows-talk Do not quote signatures (like this one) or top post when replying