diff options
author | Jon Moss <me@jonathanmoss.me> | 2016-09-25 15:40:29 -0400 |
---|---|---|
committer | Jon Moss <me@jonathanmoss.me> | 2016-10-02 08:45:38 -0400 |
commit | a5dfba4135574db62fbf3cf71ea1fd953acb4768 (patch) | |
tree | 91df32f037f8372fa5ca29ebe5fbd3acd13bd905 /actioncable/lib | |
parent | da0fdd6bf529df8806ddb4b97e4bb31c95249e0e (diff) | |
download | rails-a5dfba4135574db62fbf3cf71ea1fd953acb4768.tar.gz rails-a5dfba4135574db62fbf3cf71ea1fd953acb4768.tar.bz2 rails-a5dfba4135574db62fbf3cf71ea1fd953acb4768.zip |
Shutdown pubsub connection before classes are reloaded
Before this patch, if you were to make a file edit in your Rails
application and you tried to load up the page, it would hang
indefinitely. The issue is that Active Record is trying to cleanup after
itself and clear all active connection, but Action Cable is still
holding onto a connection from the pool. To resolve this, we are now
shutting down the pubsub adapter before classes are reloaded, to avoid
this altogether (connection is being returned to the pool).
Credits to @skateman for discovering this bug. :)
Diffstat (limited to 'actioncable/lib')
-rw-r--r-- | actioncable/lib/action_cable/engine.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/actioncable/lib/action_cable/engine.rb b/actioncable/lib/action_cable/engine.rb index 4c5c975cd8..77c358b640 100644 --- a/actioncable/lib/action_cable/engine.rb +++ b/actioncable/lib/action_cable/engine.rb @@ -70,6 +70,7 @@ module ActionCable app.reloader.before_class_unload do ActionCable.server.restart + ActionCable.server.pubsub.shutdown end end end |