Development server hangs on code changes

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Development server hangs on code changes

jomitsch
Hello all,

My colleagues and I are having issues with our development server hanging on code changes. There aren't any traceback or errors on why this is happening, but I suspect it is ActionDispatch::Reloader causing the issue.

In config/environments/development.rb, I add this to see if ActionDispatch::Reloader could be causing the issue:


   
class WhatTheHeckMiddleware
     
def initialize(app, opts = {})
       
@app = app
       
@idx = opts[:idx]
     
end
 
     
# Just log when this middleware starts and ends
     
def call(env)
       puts
"~~ wth START #{@idx} ~~"
       res
= @app.call(env)
       puts
"~~ wth END #{@idx} ~~"
       res
     
end
   
end
 
   config
.middleware.insert_before(ActionDispatch::Reloader, WhatTheHeckMiddleware, { idx: 1 })
   config
.middleware.insert_after(ActionDispatch::Reloader, WhatTheHeckMiddleware, { idx: 2 })





I reproduce the issue by making a code change and then server hangs:


2018-03-22T18:55:57 [I|app|] Started GET "/notification_recipients" for 127.0.0.1 at 2018-03-22 18:55:57 +0000
~~ wth START 1 ~~
(server hangs here, no END statement is printed)


There is a similar issue found in graphql-ruby that did result in a commit to rails. (Their issue is where I got the debugging idea above) I tried the patch to rails without luck,  It looks like we don’t even use the ActiveSupport::Reloader middleware mentioned in the issue. 

We are using Rails 5.1.4

My questions are:
- Does anyone have any ideas on what could be going on?
- Am I correct in thinking something is going wrong in ActionDispatch::Reloader?
- How can I debug this further?

Let me know if I can provide any more information.
Thanks!

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/0ad94eb9-db6f-42ea-a410-c54118def879%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Development server hangs on code changes

Hassan Schroeder-2
On Fri, Mar 23, 2018 at 6:05 AM,  <[hidden email]> wrote:

> My colleagues and I are having issues with our development server hanging on
> code changes. There aren't any traceback or errors on why this is happening,
> but I suspect it is ActionDispatch::Reloader causing the issue.

> I reproduce the issue by making a code change and then server hangs:
>
>
> 2018-03-22T18:55:57 [I|app|] Started GET "/notification_recipients" for
> 127.0.0.1 at 2018-03-22 18:55:57 +0000
> ~~ wth START 1 ~~
> (server hangs here, no END statement is printed)

Is the code you're changing related to the request method above?
Does it work as expected when you make the change and restart
the server?

Can you create and publish a simplified reproducible test case if
this isn't open source?

If not, I'd say you just need to start adding debug logger statements
(or pry breakpoints) to see where it stops...

--
Hassan Schroeder ------------------------ [hidden email]
twitter: @hassan
Consulting Availability : Silicon Valley or remote

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yD13N1F%3DMfLMMhkV%2BMF6beCeazCk9WAkd%3DjCJUgmvt1nw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.