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
[4.1.0.beta1] Generator calling generate
hangs
#13381
Comments
Works fine in Rails 3.2 and 4.0 |
/cc @jonleighton can you determine if this is a spring issue? |
@jcoyne just experienced the same problem. After forcefully killing all existing spring processes it worked. |
@jcoyne can you give me instructions on how to reproduce the problem please? |
@jonleighton Here's a generator that causes the hang: https://github.com/jcoyne/spring_bug/commit/be686db81e5e1e5c90dd5787bdb8d3d2384b1621 clone and then run $ rails g bug |
ApplicationManager#with_child wants to be able to detect an error on the socket so that we know that the application process is no longer available. It seems that merely closing the socket here is not enough to cause the error (I'm not exactly sure why), so use shutdown instead. This problem was demonstrated by rails/rails#13381, where we have spring running a rails generator, which then shells out and calls back into spring a second time (mind blown). This would be fine except for the fact that the generator changes the gemfile, which causes the application process to want to start exiting, only it can't completely exit because it's still running the generator. That's why we need to shut down the socket so that the spring server knows to start up another application process.
Thanks, that's very helpful. The above commit prevents the hanging here, but the devise:install bit will just silently fail, so this fix is still a WIP. |
A spring command should be able to change the Gemfile and then call back into spring, with the Gemfile changes reflected. See rails/rails#13381
I've just release Spring 1.1.0 which fixes this. |
FYI just happened to me. Using spring (1.1.2) |
Spring 1.1.3 > Just hangs there forever... |
I just peeked in the rep and noticed that the problem ocurred in the |
@vidbina That did the trick for me as well. Thank you! |
thanks @vidbina - solved it for me as well |
@vidbina I had the exact same issue and running |
Great, thanks! spring stop fixed this for me aswell. |
spring stop fixed for mine as well thanks! |
|
spring stop +1 |
|
When I send an INT here's the trace:
Here's the code: https://github.com/projectblacklight/blacklight/blob/v4.5.0/lib/generators/blacklight/blacklight_generator.rb#L42
The text was updated successfully, but these errors were encountered: