Ruby on Rails
Friday, March 23, 2018
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?
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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
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.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment