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
http: use current Tornado IOLoop when stopping. (Fixes #1715). #1716
Merged
jodal
merged 1 commit into
mopidy:release-2.2
from
kingosticks:fix/hang-on-stopping-http
Oct 22, 2018
Merged
http: use current Tornado IOLoop when stopping. (Fixes #1715). #1716
jodal
merged 1 commit into
mopidy:release-2.2
from
kingosticks:fix/hang-on-stopping-http
Oct 22, 2018
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kingosticks
force-pushed
the
fix/hang-on-stopping-http
branch
from
October 20, 2018 17:31
a22ba85
to
d6a5f82
Compare
jodal
approved these changes
Oct 21, 2018
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume this works for Tornado 4.4 and upwards?
Yep I did a few tests on both tornado 5 and 4.4, seems fine. |
Maybe target this for the |
This is in response to the breaking change in Tornado v5.0 where IOLoop.instance is now a deprecated alias for IOLoop.current. More info at https://www.tornadoweb.org/en/stable/releases/v5.0.0.html
kingosticks
force-pushed
the
fix/hang-on-stopping-http
branch
from
October 22, 2018 14:33
d6a5f82
to
1d30e73
Compare
kingosticks
added a commit
to kingosticks/mopidy
that referenced
this pull request
Sep 8, 2019
In Tornado 4.x and earlier, IOLoop.current() would return the global IOLoop if there was no IOLoop already running in the calling thread. This was the case when calling our websocket broadcast method from the HttpFrontend thread and so callbacks were correctly scheduled on the HttpServer thread's IOLoop. However, in Tornado 5.0+, the idea of a global IOLoop is gone and calling IOLoop.current() will simply create a new IOLoop if there isn't one already running in the calling thread. This incorrectly resulted in callbacks being scheduled on that new IOLoop which is never actually started and so the broadcasts were never sent. This is related to mopidy#1716.
kingosticks
added a commit
that referenced
this pull request
Sep 9, 2019
In Tornado 4.x and earlier, IOLoop.current() would return the global IOLoop if there was no IOLoop already running in the calling thread. This was the case when calling our websocket broadcast method from the HttpFrontend thread and so callbacks were correctly scheduled on the HttpServer thread's IOLoop. However, in Tornado 5.0+, the idea of a global IOLoop is gone and calling IOLoop.current() will simply create a new IOLoop if there isn't one already running in the calling thread. This incorrectly resulted in callbacks being scheduled on that new IOLoop which is never actually started and so the broadcasts were never sent. This is related to #1716.
jodal
pushed a commit
that referenced
this pull request
Sep 30, 2019
In Tornado 4.x and earlier, IOLoop.current() would return the global IOLoop if there was no IOLoop already running in the calling thread. This was the case when calling our websocket broadcast method from the HttpFrontend thread and so callbacks were correctly scheduled on the HttpServer thread's IOLoop. However, in Tornado 5.0+, the idea of a global IOLoop is gone and calling IOLoop.current() will simply create a new IOLoop if there isn't one already running in the calling thread. This incorrectly resulted in callbacks being scheduled on that new IOLoop which is never actually started and so the broadcasts were never sent. This is related to #1716. (cherry picked from commit 59a3935)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
From Tornado v5.0:
We were using IOLoop.instance to stop the HTTP server thread from a different thread.