Skip to content
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

Mopidy doesn't exit with Tornado v5.0+ #1715

Closed
kingosticks opened this issue Oct 20, 2018 · 1 comment

Comments

@kingosticks
Copy link
Member

commented Oct 20, 2018

When the HTTP extension is enabled, Mopidy with Tornado v5.0+ does not exit on receiving SIGINT. The logging shows the following and then seemingly hangs and must be killed:

^CINFO     2018-10-20 17:29:18,911 [11390:MainThread] mopidy.commands
  Interrupted. Exiting...
INFO     2018-10-20 17:29:18,912 [11390:MainThread] mopidy.commands
  Stopping Mopidy frontends
INFO     2018-10-20 17:29:18,921 [11390:MainThread] mopidy.commands
  Stopping Mopidy core
INFO     2018-10-20 17:29:18,922 [11390:MainThread] mopidy.commands
  Stopping Mopidy backends
INFO     2018-10-20 17:29:18,964 [11390:MainThread] mopidy.commands
  Stopping Mopidy audio
INFO     2018-10-20 17:29:18,966 [11390:MainThread] mopidy.commands
  Stopping Mopidy mixer

Mopidy exits cleanly when the HTTP extension is disabled.

This appears to be related to our usage of IOLoop.instance when stopping:

IOLoop.instance is now a deprecated alias for IOLoop.current. Applications that need the cross-thread communication behavior facilitated by IOLoop.instance should use their own global variable instead.

Deprecated alias for IOLoop.current().

Changed in version 5.0: Previously, this method returned a global singleton IOLoop, in contrast with the per-thread IOLoop returned by current(). In nearly all cases the two were the same (when they differed, it was generally used from non-Tornado threads to communicate back to the main thread’s IOLoop).

Reported a few times, most recently at https://discourse.mopidy.com/t/mopidy-as-service-at-shutdown/2826/

kingosticks added a commit to kingosticks/mopidy that referenced this issue Oct 20, 2018

kingosticks added a commit to kingosticks/mopidy that referenced this issue Oct 20, 2018

http: use current Tornado IOLoop when stopping. (Fixes mopidy#1715).
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 added a commit to kingosticks/mopidy that referenced this issue Oct 22, 2018

http: use current Tornado IOLoop when stopping. (Fixes mopidy#1715).
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

jodal added a commit that referenced this issue Oct 22, 2018

Merge pull request #1716 from kingosticks/fix/hang-on-stopping-http
http: use current Tornado IOLoop when stopping. (Fixes #1715).

@jodal jodal added this to the v2.2.2 milestone Oct 22, 2018

@jodal

This comment has been minimized.

Copy link
Member

commented Oct 22, 2018

Fixed by #1716.

@jodal jodal closed this Oct 22, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.