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: Fix threading issue causing duplicate WS messages #1127

Merged
merged 1 commit into from Apr 14, 2015

Conversation

3 participants
@adamcik
Member

adamcik commented Apr 14, 2015

The problem presents itself when a JSON-RPC call triggers some event in core.
When this happens we have a thread outside of Tornado call write_message
interleaved with a potentially ongoing write if the JSON-RPC response.

To avoid this we now follow Tornado best practices and add callbacks to the
IOLoop to ensure that there isn't any interleaved access of Tornado state.

http: Fix threading issue causing duplicate WS messages
The problem presents itself when a JSON-RPC call triggers some event in core.
When this happens we have a thread outside of Tornado call `write_message`
interleaved with a potentially ongoing write if the JSON-RPC response.

To avoid this we now follow Tornado best practices and add callbacks to the
IOLoop to ensure that there isn't any interleaved access of Tornado state.
@kingosticks

This comment has been minimized.

Member

kingosticks commented Apr 14, 2015

👍 from me, nice quick fix!

@jodal jodal added this to the v1.0.x milestone Apr 14, 2015

@jodal jodal self-assigned this Apr 14, 2015

@jodal jodal added the A-http label Apr 14, 2015

jodal added a commit that referenced this pull request Apr 14, 2015

Merge pull request #1127 from adamcik/fix/broadcast-threading-bug
http: Fix threading issue causing duplicate WS messages

@jodal jodal merged commit 577a85b into mopidy:v1.0.x Apr 14, 2015

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage decreased (-0.02%) to 76.23%
Details

@adamcik adamcik deleted the adamcik:fix/broadcast-threading-bug branch May 12, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment