Rainbows! Rack HTTP server user/dev discussion
 help / Atom feed
From: Thorsten von Eicken <tve-nkzjiHSqi6rZJqsBc5GL+g@public.gmane.org>
To: Eric Wong <normalperson-rMlxZR9MS24@public.gmane.org>
Cc: Rainbows! list <rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org>
Subject: Re: HUP restart is delayed by 2 minutes
Date: Mon, 17 Mar 2014 14:23:46 -0700
Message-ID: <532767E2.70509@rightscale.com> (raw)
In-Reply-To: <20140129220352.GA24393-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org>

Thanks for the 4.6.1 update. I pulled it a few weeks ago, but I am still
having problems with the rainbows restart and EM. I pretty consistently
get a segfault:

/var/lib/gems/1.9.1/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:
[BUG] Segmentation fault
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]

-- Control frame information -----------------------------------------------
c:0014 p:---- s:0064 b:0064 l:000063 d:000063 CFUNC  :run_machine
c:0013 p:0325 s:0061 b:0061 l:000060 d:000060 METHOD
/var/lib/gems/1.9.1/gems/eventmachine-1.0.3/lib/eventmachine.rb:187
c:0012 p:0304 s:0054 b:0054 l:0008e8 d:0008e8 METHOD
/var/lib/gems/1.9.1/gems/rainbows-4.6.1/lib/rainbows/event_machine.rb:86
c:0011 p:0103 s:0047 b:0047 l:000046 d:000046 METHOD
/var/lib/gems/1.9.1/gems/rainbows-4.6.1/lib/rainbows/http_server.rb:45
c:0010 p:0146 s:0041 b:0041 l:000040 d:000040 METHOD
/var/lib/gems/1.9.1/gems/unicorn-4.8.2/lib/unicorn/http_server.rb:521
c:0009 p:0252 s:0034 b:0034 l:000033 d:000033 METHOD
/var/lib/gems/1.9.1/gems/rainbows-4.6.1/lib/rainbows/http_server.rb:61
c:0008 p:0058 s:0030 b:0030 l:000029 d:000029 METHOD
/var/lib/gems/1.9.1/gems/unicorn-4.8.2/lib/unicorn/http_server.rb:532
c:0007 p:0347 s:0026 b:0026 l:000025 d:000025 METHOD
/var/lib/gems/1.9.1/gems/unicorn-4.8.2/lib/unicorn/http_server.rb:290
c:0006 p:0264 s:0019 b:0019 l:001f28 d:001f28 TOP   
/var/lib/gems/1.9.1/gems/rainbows-4.6.1/bin/rainbows:127
c:0005 p:---- s:0013 b:0013 l:000012 d:000012 FINISH
c:0004 p:---- s:0011 b:0011 l:000010 d:000010 CFUNC  :load
c:0003 p:0127 s:0007 b:0007 l:000ae8 d:002080 EVAL  
/var/lib/gems/1.9.1/bin/rainbows:19
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:000ae8 d:000ae8 TOP

-- Ruby level backtrace information ----------------------------------------
/var/lib/gems/1.9.1/bin/rainbows:19:in `<main>'
/var/lib/gems/1.9.1/bin/rainbows:19:in `load'
/var/lib/gems/1.9.1/gems/rainbows-4.6.1/bin/rainbows:127:in `<top
(required)>'
/var/lib/gems/1.9.1/gems/unicorn-4.8.2/lib/unicorn/http_server.rb:290:in
`join'
/var/lib/gems/1.9.1/gems/unicorn-4.8.2/lib/unicorn/http_server.rb:532:in
`maintain_worker_count'
/var/lib/gems/1.9.1/gems/rainbows-4.6.1/lib/rainbows/http_server.rb:61:in `spawn_missing_workers'
/var/lib/gems/1.9.1/gems/unicorn-4.8.2/lib/unicorn/http_server.rb:521:in
`spawn_missing_workers'
/var/lib/gems/1.9.1/gems/rainbows-4.6.1/lib/rainbows/http_server.rb:45:in `worker_loop'
/var/lib/gems/1.9.1/gems/rainbows-4.6.1/lib/rainbows/event_machine.rb:86:in
`worker_loop'
/var/lib/gems/1.9.1/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run'
/var/lib/gems/1.9.1/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in
`run_machine'

-- C level backtrace information -------------------------------------------
/var/lib/gems/1.9.1/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:
[BUG] Segmentation fault
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]

I'm happy to provide additional information, if useful!

Cheers,
Thorsten

On 1/29/2014 2:03 PM, Eric Wong wrote:
> Thanks!  Can you try this?  Sorry I haven't maintained EM support
> well, I forgot some versions were broken under Ruby 2.x :x
>
> (also "gem install --pre  -v 4.6.0.4.g4108 rainbows" should work)
>
> --- a/lib/rainbows/event_machine.rb
> +++ b/lib/rainbows/event_machine.rb
> @@ -88,7 +88,17 @@ module Rainbows::EventMachine
>          raise RuntimeError, "EM @conns instance variable not accessible!"
>        Rainbows::EventMachine::Server.const_set(:CUR, conns)
>        Rainbows.at_quit do
> -        EM.next_tick { conns.each_value { |c| client_class === c and c.quit } }
> +        EM.next_tick do
> +          LISTENERS.clear
> +          conns.each_value do |c|
> +            case c
> +            when client_class
> +              c.quit
> +            when Rainbows::EventMachine::Server
> +              c.detach
> +            end
> +          end
> +        end
>        end
>        EM.add_periodic_timer(1) do
>          EM.stop if ! Rainbows.tick && conns.empty? && EM.reactor_running?
>

_______________________________________________
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 index

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-29  6:03 Thorsten von Eicken
     [not found] ` <52E89997.6020504-nkzjiHSqi6rZJqsBc5GL+g@public.gmane.org>
2014-01-29  7:02   ` Eric Wong
     [not found]     ` <20140129070259.GA5938-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org>
2014-01-29  7:26       ` Thorsten von Eicken
     [not found]         ` <52E8AD1B.8090009-nkzjiHSqi6rZJqsBc5GL+g@public.gmane.org>
2014-01-29  7:32           ` Eric Wong
2014-01-29  8:31           ` Eric Wong
     [not found]             ` <20140129083147.GA26652-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org>
2014-01-29 20:11               ` Thorsten von Eicken
     [not found]                 ` <52E9607A.60107-nkzjiHSqi6rZJqsBc5GL+g@public.gmane.org>
2014-01-29 22:03                   ` Eric Wong
     [not found]                     ` <20140129220352.GA24393-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org>
2014-01-29 22:41                       ` Thorsten von Eicken
2014-03-17 21:23                       ` Thorsten von Eicken [this message]
     [not found]                         ` <532767E2.70509-nkzjiHSqi6rZJqsBc5GL+g@public.gmane.org>
2014-03-17 21:27                           ` Eric Wong

Reply instructions:

You may reply publically 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://bogomips.org/rainbows/

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

  git send-email \
    --in-reply-to=532767E2.70509@rightscale.com \
    --to=tve-nkzjihsqi6rzjqsbc5gl+g@public.gmane.org \
    --cc=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

Rainbows! Rack HTTP server user/dev discussion

Archives are clonable:
	git clone --mirror https://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