Rainbows! Rack HTTP server user/dev discussion
 help / color / mirror / code / Atom feed
From: Eric Wong <normalperson-rMlxZR9MS24@public.gmane.org>
To: Rainbows! list <rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org>
Subject: Re: BUG: HUP signal reloads config, but gives RuntimeError - Application has already initialized
Date: Wed, 4 Sep 2013 17:21:49 +0000	[thread overview]
Message-ID: <20130904172149.GA2713@dcvr.yhbt.net> (raw)
In-Reply-To: <410FB453-44E7-4F7D-BC29-4AA36A0C412C-rCoryE6l9AakgyF2CNKXmw@public.gmane.org>

Patrick Hanevold <patrick-rCoryE6l9AakgyF2CNKXmw@public.gmane.org> 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


      parent reply	other threads:[~2013-09-04 17:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-04 11:59 BUG: HUP signal reloads config, but gives RuntimeError - Application has already initialized Patrick Hanevold
     [not found] ` <410FB453-44E7-4F7D-BC29-4AA36A0C412C-rCoryE6l9AakgyF2CNKXmw@public.gmane.org>
2013-09-04 17:21   ` Eric Wong [this message]

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/rainbows/

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

  git send-email \
    --in-reply-to=20130904172149.GA2713@dcvr.yhbt.net \
    --to=normalperson-rmlxzr9ms24@public.gmane.org \
    --cc=rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.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/rainbows.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).