Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Child processes hang and won't die under Ruby 1.9 #11

Closed
rtomayko opened this issue Jan 16, 2010 · 10 comments
Closed

Child processes hang and won't die under Ruby 1.9 #11

rtomayko opened this issue Jan 16, 2010 · 10 comments

Comments

@rtomayko
Copy link
Owner

Running under Ruby 1.9 w/ webrick, the child processes are hanging pretty much immediately after fork. I think the issue may be that the child processes still have the parent process's accept socket open and so children are getting requests. Needs more research.

@speedmax
Copy link

confirmed,
ruby 1.9
Shotgun 0.6

works
ruby config.ru

doesn't work, it's just hangs there forever
shotgun config.ru

@ghost
Copy link

ghost commented Mar 30, 2010

I'm not sure if this is related, but I've found that whenever I start my Sinatra app using Shotgun, the first request hangs indefinitely. After I hit refresh everything works fine, but when I try to kill webrick it hangs at "going to shutdown ..." until I open up Activity Monitor and manually kill the Ruby process(es). This doesn't happen when I use rackup, so I assume the problem is with Shotgun. (Ruby 1.9.1p376, Shotgun 0.6)

@noonat
Copy link

noonat commented Apr 30, 2010

This seems to be due to Marshal causing a deadlock. Like grant said, it's just that first request that deadlocks... if I kill that request, the server shuts down normally. Also, the forked parent PID is the main parent PID for subsequent requests, so I don't think the child is accepting connections.

@noonat
Copy link

noonat commented Apr 30, 2010

I think this is the issue causing it for me:
http://redmine.ruby-lang.org/issues/show/1525

@ryansobol
Copy link

Maybe the simplest solution is to add some logic to prevent shotgun from firing up Webrick when it detects Ruby 1.9?

@wilkerlucio
Copy link

here with Shotgun 0.8 and Ruby 1.9 the application dont works, results on load error (cant find the file of my app)

@martinisoft
Copy link

+1 it cannot load my app file when using Webrick or Thin on Ruby 1.9.2-p0 with Shotgun 0.8 and Sinatra 1.1.0.

Backtrace:

internal:lib/rubygems/custom_require:29:in require' <internal:lib/rubygems/custom_require>:29:inrequire'
/usr/local/Cellar/gems/1.9/gems/shotgun-0.8/lib/shotgun/loader.rb:114:in inner_app' /usr/local/Cellar/gems/1.9/gems/shotgun-0.8/lib/shotgun/loader.rb:102:inassemble_app'
/usr/local/Cellar/gems/1.9/gems/shotgun-0.8/lib/shotgun/loader.rb:86:in proceed_as_child' /usr/local/Cellar/gems/1.9/gems/shotgun-0.8/lib/shotgun/loader.rb:31:incall!'
/usr/local/Cellar/gems/1.9/gems/shotgun-0.8/lib/shotgun/loader.rb:18:in call' /usr/local/Cellar/gems/1.9/gems/shotgun-0.8/lib/shotgun/favicon.rb:12:incall'
/usr/local/Cellar/gems/1.9/gems/rack-1.2.1/lib/rack/builder.rb:77:in call' /usr/local/Cellar/gems/1.9/gems/rack-1.2.1/lib/rack/content_length.rb:13:incall'
/usr/local/Cellar/gems/1.9/gems/rack-1.2.1/lib/rack/chunked.rb:15:in call' /usr/local/Cellar/gems/1.9/gems/thin-1.2.7/lib/thin/connection.rb:76:inblock in pre_process'
/usr/local/Cellar/gems/1.9/gems/thin-1.2.7/lib/thin/connection.rb:74:in catch' /usr/local/Cellar/gems/1.9/gems/thin-1.2.7/lib/thin/connection.rb:74:inpre_process'
/usr/local/Cellar/gems/1.9/gems/thin-1.2.7/lib/thin/connection.rb:57:in process' /usr/local/Cellar/gems/1.9/gems/thin-1.2.7/lib/thin/connection.rb:42:inreceive_data'
/usr/local/Cellar/gems/1.9/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in run_machine' /usr/local/Cellar/gems/1.9/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:inrun'
/usr/local/Cellar/gems/1.9/gems/thin-1.2.7/lib/thin/backends/base.rb:57:in start' /usr/local/Cellar/gems/1.9/gems/thin-1.2.7/lib/thin/server.rb:156:instart'
/usr/local/Cellar/gems/1.9/gems/rack-1.2.1/lib/rack/handler/thin.rb:14:in run' /usr/local/Cellar/gems/1.9/gems/shotgun-0.8/bin/shotgun:156:in<top (required)>'
/usr/local/bin/shotgun:19:in load' /usr/local/bin/shotgun:19:in

'

@martinisoft
Copy link

Aha, correction, this has been fixed in issue http://github.com/rtomayko/shotgun/issues/closed#issue/22 and this is a duplicate, at least for my problem. Installing the gem via git worked like a charm :)

@rtomayko
Copy link
Owner Author

The LoadError related issues should be fixed. Could those of you that were having issues on the first request give 0.9 a try and see if that fixes anything for you?

@djanowski
Copy link
Collaborator

We assume this is no longer an issue. Please file a new issue if it is. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants