Solved Python GIL issues since PR #901
#1
Hello,

This thread is a followup of an issue I began discussing on a github pull request:
https://github.com/xbmc/xbmc/pull/901#is...nt-9084511

On an addon I'm working on (Spotimc), freezes XBMC for a while when playback is requested, leading to timeout errors on the end.

The issue happens when playback is requested from python to a resource served by an embedded http server (CherryPy for example), started on the same process space as XBMC.

In short, the following chain of events should explain what's going on behind the scenes:
  • Playback is requested from python to an url of the embedded server.
  • XBMC opens an http connection to the embedded server.
  • On another python thread the server should handle the request, but it can't since the python GIL is still owned by (1). As a result the requests always time out.

I've created a simple addon which should help to reproduce the issue easily. It just starts a python server, and pressing the play button tells XBMC to start playing a file served by this server. In the presence of the issue XBMC should freeze for a while like it does with Spotimc. The addon can be downloaded here:
https://github.com/downloads/mazkolain/s...iltest.zip

Hope all this info turns useful to resolve the issue.

Thanks in advance.
Reply
#2
Sorry for the late reply on this and thanks for the script. Hopefully you can give me another day or two. You're next on my backlog.

Thanks again.
Reply
#3
This is *probably* resolved - depending on whether or not I guessed right about what the problem is.
Reply
#4
The above comment was for another post. Sorry about that.

Fixed here: https://github.com/xbmc/xbmc/commit/c61c...967f275d8b

Thanks for the gift wrapped repro-script. That really helped. Sorry for the delay.
Reply
#5
The fix works perfectly. Thank you!
Reply

Logout Mark Read Team Forum Stats Members Help
Python GIL issues since PR #9010