-
Notifications
You must be signed in to change notification settings - Fork 21.9k
rails new and rails server sometime hangs and crashes on busy F5(reloading) while starting #27455
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
Comments
Can't reproduce. Rails 5.0.1 |
The crash sounds like a ruby bug. The unresponsive hang is probably a deadlock; you might be able to better identify it using ActionDispatch::DebugLocks. |
I could reproduce the hanging and crashing issue on Rails5.0.1/ruby2.4 . |
@matthewd Thank you ! It looks, multiple thread(Thread0, 2) calls const_get at the same time,
Crash report also says it locked on "autoload_reset" called on "rb_mod_const_get".
I can guess, "const_get" may not always thread safe when it causes autloading, and need to be synchronized ? |
And, the issue does not happens if I set "config.eager_load = true". |
Better way to reproduce the hanging issue (I could reproduce 100%). Run the following command just after running "rails server".
|
Wondering if we can get someone to take another look at @yoshiokatsuneo's info here. We have people reporting this at puma/puma#1184, but none of them have the problem if a) threading is off or b) eager_load is on. |
@nateberkopec this particular issue is a problem specific to the built-in Rails::WelcomeController. Other threading issues should be investigated with DebugLocks and reported separately. |
This issue has been automatically marked as stale because it has not been commented on for at least three months. |
I'm still running into this issue on 5.1.4, running Puma 3.11.2, and ruby 2.4.3. Even when running the server with Webrick, it hangs so pretty sure this is a Rails issue. I'm running the Rails server as a JSON API project. Our front-end code makes multiple Ajax requests to the Rails server without waiting for a response before sending the next request, and this seems to be causing the hanging. If I throttle/decrease the number of requests, the server does not hang. I did try to set |
I'm going through this with rails 5.1.6 and puma 3.11.3 |
We are running into this issue on Ruby 2.4.4p296, Rails 5.1.4, Puma 3.9.1. We can also reproduce it on later versions of ruby. The |
Same, with Rails 6.0 |
Happening here as well. Specs: Ruby: Even with the |
Running into this issue as well, it should be reoppened Ruby: I tried isolating the issue, but I run into it in several conditions, when I get multiple requests, when I run into an error, fix the code and go back to the app I find that the server is hanging I tried the suggested fixes related to eager load and asset debugging but nothing helped |
Really similar versions for a project I'm working with as well (running on Ruby 2.7 and soon upgrading to Ruby 3.0/Rails 6.1, but I'm quite sure this issue won't disappear). There we have connected the issue with Webpack dev-server. But now reading this issue here, the root cause may reside else. |
Maybe worth mentioning what autoloader is being used as well, since this may be autoloader issue. We are currently stuck with classic autoloader and I cannot reproduce this with zeitwerk, since we need to port to it. |
I am having this issue as well. |
Uh oh!
There was an error while loading. Please reload this page.
Steps to reproduce
Or, on the browser(Safari, Chrome), just push F5(reloading) button many times(like 3 times / sec).
But, in this case, I can reproduce the issue once in 3-10 times.
The problem does not happens if I change the number of puma thread from 5 to 1. So, I guess it is related to multi threading.
I see the issue on both Mac OS Sierra, and Ubuntu16.04.
I see the issue on both sqlite3 and mysql database.
Expected behavior
Rails should not crash and response like:
Actual behavior
Sometimes, (like once in 3-10 times) Rails hang up and never response, and output log like below:
In rare case, after pushing Ctrl-C, following crashing report follows.
I attached the full crashing message, and diagnose report.
System configuration
Rails version:
5.0.1
Ruby version:
ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-darwin16]
ruby_2016-12-26-152934_MacBook-Pro-2.crash.txt
rails_server_crash_output.txt
rails_server_crash_output_linux.txt
The text was updated successfully, but these errors were encountered: