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

Failure with polling client in MPD network code #781

adamcik opened this issue Jul 14, 2014 · 3 comments

Failure with polling client in MPD network code #781

adamcik opened this issue Jul 14, 2014 · 3 comments


Copy link

@adamcik adamcik commented Jul 14, 2014

while sleep 1; do mpc status; done manages to trigger:

Traceback (most recent call last):
  File "/home/adamcik/dev/mopidy/mopidy/utils/", line 272, in recv_callback
  File "/home/adamcik/dev/mopidy/mopidy/utils/", line 236, in disable_recv
TypeError: an integer is required
@adamcik adamcik added the MPD label Jul 14, 2014
@jodal jodal added the bug label Jul 18, 2014
Copy link

@jodal jodal commented Jul 18, 2014

Can't reproduce in 10 minutes of running the while loop.

Copy link

@trygveaa trygveaa commented Aug 6, 2014

I can reproduce this with:
while true; do mpc next; done

I can't see any consistency in when it happens, but it happens fairly often. Often after 20-50 iterations, sometimes more.

I can't seem to reproduce this with the status command.

@trygveaa trygveaa self-assigned this Aug 13, 2014
@trygveaa trygveaa added this to the v0.19.4 milestone Aug 13, 2014
trygveaa added a commit to trygveaa/mopidy that referenced this issue Aug 13, 2014
As of d62ad96, when the connection can't receive more data from the
client, it tells the actor to stop the connection and calls
disable_recv(). The actor operates in it's own thread and when it stops
the connection, disable_recv is being called again from a different
thread. Since the actor is told to stop the connection before
disable_recv is called, the two calls to disable_recv may happen

This causes a race condition issue where both threads can reach past the
check that recv_id is not None before either of them set it to None. If
one of them set it to None before the other one tries to use it, an
error is raised.

This commit calls disable_recv before telling the actor to stop the
connection. Since disable_recv is a blocking call, this ensures that
recv_id is being set to None before the actor thread begins to stop the

Fixes mopidy#781
Copy link

@jodal jodal commented Aug 29, 2014

Hopefully fixed with the merge of PR#827.

@jodal jodal closed this Aug 29, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants