Skip to content

Some certain application fails to reload #466

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

Closed
tycooon opened this issue Jan 13, 2016 · 4 comments
Closed

Some certain application fails to reload #466

tycooon opened this issue Jan 13, 2016 · 4 comments

Comments

@tycooon
Copy link

tycooon commented Jan 13, 2016

So i have 2 apps, one of them restarts just fine:

$ spring status
Spring is running:

74825 spring server | app1 | started 4 mins ago
75216 spring app    | app1 | started 3 mins ago | development mode

$ touch Gemfile.lock

# Run rails c in other tab – it works just fine but takes some time because app is reloaded.

$ spring status
Spring is running:

74825 spring server | app1 | started 5 mins ago
75498 spring app    | app1 | started 14 secs ago | development mode

But the other one just hangs when i touch the gemfile:

bash-3.2$ spring status
Spring is running:

75643 spring server | app2 | started 14 secs ago
75664 spring app    | app2 | started 14 secs ago | development mode

$ touch Gemfile.lock

# Try to run rails c in other tab – it hangs forever

$ spring status
Spring is running:

75643 spring server | app2 | started 1 min ago
75696 (ruby) # this process is dead

Both applications use spring 1.6.0 and ruby 2.3.0. Is there a way for me to debug why does the second application hang? It seems to me that the problem is somewhere in the app code, but I have no idea how to debug this.

@tycooon
Copy link
Author

tycooon commented Jan 13, 2016

P.S. All I get in spring log after touching gemfile is this:

[2016-01-13 18:39:19 +0300] [76550] [application:development] preloading app
[2016-01-13 18:39:27 +0300] [76550] [application:development] initialized -> running
/Users/tycooon/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/spring-1.6.0/lib/spring/application.rb:286:in `read': stream closed (IOError)
    from /Users/tycooon/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/spring-1.6.0/lib/spring/application.rb:286:in `block (2 levels) in with_pty'`

76550 is the actual process that hangs.

@ayufan
Copy link
Contributor

ayufan commented Jun 30, 2016

Check this out: #484

@tycooon
Copy link
Author

tycooon commented Jun 30, 2016

It turns out the problem was in this initializer in my app:

unless Rails.env.production?
  Thread.abort_on_exception = true
end

I just removed it and reloading works fine.

@tycooon tycooon closed this as completed Jun 30, 2016
@ayufan
Copy link
Contributor

ayufan commented Jun 30, 2016

Yes, it's. My MR tries to fix that problem.

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

2 participants