Rainbows! Rack HTTP server user/dev discussion
 help / Atom feed
* BUG: HUP signal reloads config, but gives RuntimeError - Application has already initialized
@ 2013-09-04 11:59 Patrick Hanevold
       [not found] ` <410FB453-44E7-4F7D-BC29-4AA36A0C412C-rCoryE6l9AakgyF2CNKXmw@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Patrick Hanevold @ 2013-09-04 11:59 UTC (permalink / raw)
  To: rainbows-talk-GrnCvJ7WPxnNLxjTenLetw


Why aren't you guys on github?

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)
E, [2013-09-04T13:53:52.196955 #7953] ERROR -- : /home/capistrano/sites/fargekladden/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application.rb:214:in `initialize!'
E, [2013-09-04T13:53:52.197116 #7953] ERROR -- : /home/capistrano/sites/fargekladden/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
E, [2013-09-04T13:53:52.197295 #7953] ERROR -- : /home/capistrano/sites/fargekladden/releases/20130904115254/config/environment.rb:5:in `<top (required)>'
E, [2013-09-04T13:53:52.200897 #7953] ERROR -- : /home/capistrano/sites/fargekladden/shared/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
E, [2013-09-04T13:53:52.201088 #7953] ERROR -- : /home/capistrano/sites/fargekladden/shared/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `block in require'
E, [2013-09-04T13:53:52.201231 #7953] ERROR -- : /home/capistrano/sites/fargekladden/shared/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency'
E, [2013-09-04T13:53:52.201369 #7953] ERROR -- : /home/capistrano/sites/fargekladden/shared/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
E, [2013-09-04T13:53:52.201505 #7953] ERROR -- : config.ru:4:in `block in <main>'
E, [2013-09-04T13:53:52.201637 #7953] ERROR -- : /home/capistrano/sites/fargekladden/shared/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
E, [2013-09-04T13:53:52.204911 #7953] ERROR -- : /home/capistrano/sites/fargekladden/shared/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
E, [2013-09-04T13:53:52.212898 #7953] ERROR -- : config.ru:1:in `new'
E, [2013-09-04T13:53:52.220887 #7953] ERROR -- : config.ru:1:in `<main>'
E, [2013-09-04T13:53:52.221056 #7953] ERROR -- : /home/capistrano/sites/fargekladden/shared/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn.rb:48:in `eval'
E, [2013-09-04T13:53:52.224886 #7953] ERROR -- : /home/capistrano/sites/fargekladden/shared/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn.rb:48:in `block in builder'
E, [2013-09-04T13:53:52.225050 #7953] ERROR -- : /home/capistrano/sites/fargekladden/shared/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:722:in `call'
E, [2013-09-04T13:53:52.228917 #7953] ERROR -- : /home/capistrano/sites/fargekladden/shared/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:722:in `build_app!'
E, [2013-09-04T13:53:52.229112 #7953] ERROR -- : /home/capistrano/sites/fargekladden/shared/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:703:in `load_config!'
E, [2013-09-04T13:53:52.232887 #7953] ERROR -- : /home/capistrano/sites/fargekladden/shared/bundle/ruby/2.0.0/gems/rainbows-4.5.0/lib/rainbows/http_server.rb:36:in `load_config!'
E, [2013-09-04T13:53:52.233053 #7953] ERROR -- : /home/capistrano/sites/fargekladden/shared/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:308:in `join'
E, [2013-09-04T13:53:52.233191 #7953] ERROR -- : /home/capistrano/sites/fargekladden/shared/bundle/ruby/2.0.0/gems/rainbows-4.5.0/bin/rainbows:127:in `<top (required)>'
E, [2013-09-04T13:53:52.236910 #7953] ERROR -- : /home/capistrano/sites/fargekladden/shared/bundle/ruby/2.0.0/bin/rainbows:23:in `load'
E, [2013-09-04T13:53:52.237101 #7953] ERROR -- : /home/capistrano/sites/fargekladden/shared/bundle/ruby/2.0.0/bin/rainbows:23:in `<main>'
I, [2013-09-04T13:53:53.233967 #7953]  INFO -- : reaped #<Process::Status: pid 9788 exit 0> worker=13
I, [2013-09-04T13:53:53.241725 #7953]  INFO -- : reaped #<Process::Status: pid 9782 exit 0> worker=10
I, [2013-09-04T13:53:53.241973 #7953]  INFO -- : reaped #<Process::Status: pid 9785 exit 0> worker=15
I, [2013-09-04T13:53:53.242136 #7953]  INFO -- : reaped #<Process::Status: pid 9794 exit 0> worker=9
I, [2013-09-04T13:53:53.242266 #7953]  INFO -- : reaped #<Process::Status: pid 9797 exit 0> worker=4
I, [2013-09-04T13:53:53.242386 #7953]  INFO -- : reaped #<Process::Status: pid 9801 exit 0> worker=14
I, [2013-09-04T13:53:53.242513 #7953]  INFO -- : reaped #<Process::Status: pid 9804 exit 0> worker=1
I, [2013-09-04T13:53:53.289027 #7953]  INFO -- : reaped #<Process::Status: pid 9776 exit 0> worker=0
I, [2013-09-04T13:53:53.289304 #7953]  INFO -- : reaped #<Process::Status: pid 9778 exit 0> worker=3
I, [2013-09-04T13:53:53.289430 #7953]  INFO -- : reaped #<Process::Status: pid 9791 exit 0> worker=2
I, [2013-09-04T13:53:53.289549 #7953]  INFO -- : reaped #<Process::Status: pid 9807 exit 0> worker=5
I, [2013-09-04T13:53:53.289696 #7953]  INFO -- : reaped #<Process::Status: pid 9809 exit 0> worker=11
I, [2013-09-04T13:53:53.302644 #10127]  INFO -- : Rainbows! FiberSpawn worker_connections=1024
I, [2013-09-04T13:53:53.312138 #10137]  INFO -- : Rainbows! FiberSpawn worker_connections=1024
I, [2013-09-04T13:53:53.314065 #10125]  INFO -- : Rainbows! FiberSpawn worker_connections=1024
I, [2013-09-04T13:53:53.327301 #10130]  INFO -- : Rainbows! FiberSpawn worker_connections=1024
I, [2013-09-04T13:53:53.337172 #10134]  INFO -- : Rainbows! FiberSpawn worker_connections=1024
I, [2013-09-04T13:53:53.342216 #10140]  INFO -- : Rainbows! FiberSpawn worker_connections=1024
I, [2013-09-04T13:53:53.345074 #7953]  INFO -- : reaped #<Process::Status: pid 9812 exit 0> worker=12
I, [2013-09-04T13:53:53.320694 #10143]  INFO -- : Rainbows! FiberSpawn worker_connections=1024
I, [2013-09-04T13:53:53.356184 #10152]  INFO -- : Rainbows! FiberSpawn worker_connections=1024
I, [2013-09-04T13:53:53.361563 #10146]  INFO -- : Rainbows! FiberSpawn worker_connections=1024
I, [2013-09-04T13:53:53.363115 #10149]  INFO -- : Rainbows! FiberSpawn worker_connections=1024
I, [2013-09-04T13:53:53.371039 #10155]  INFO -- : Rainbows! FiberSpawn worker_connections=1024
I, [2013-09-04T13:53:53.373356 #10158]  INFO -- : Rainbows! FiberSpawn worker_connections=1024
I, [2013-09-04T13:53:53.375670 #10161]  INFO -- : Rainbows! FiberSpawn worker_connections=1024


_______________________________________________
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


^ permalink raw reply	[flat|threaded] 2+ messages in thread

* Re: BUG: HUP signal reloads config, but gives RuntimeError - Application has already initialized
       [not found] ` <410FB453-44E7-4F7D-BC29-4AA36A0C412C-rCoryE6l9AakgyF2CNKXmw@public.gmane.org>
@ 2013-09-04 17:21   ` Eric Wong
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Wong @ 2013-09-04 17:21 UTC (permalink / raw)
  To: Rainbows! list

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


^ permalink raw reply	[flat|threaded] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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

Rainbows! Rack HTTP server user/dev discussion

Archives are clonable:
	git clone --mirror http://bogomips.org/rainbows-public
	git clone --mirror http://ou63pmih66umazou.onion/rainbows-public

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.lang.ruby.rainbows
	nntp://ou63pmih66umazou.onion/inbox.comp.lang.ruby.rainbows

 note: .onion URLs require Tor: https://www.torproject.org/
       or Tor2web: https://www.tor2web.org/

AGPL code for this site: git clone https://public-inbox.org/ public-inbox