Solved Issue - Python GIL issues since PR #901

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
mazkolain Offline
Senior Member
Posts: 118
Joined: Mar 2012
Reputation: 13
Post: #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.
(This post was last modified: 2012-11-05 15:27 by Montellese.)
find quote
jfcarroll Offline
Team-XBMC Developer
Posts: 453
Joined: Dec 2006
Reputation: 3
Location: Philadelphia area, US
Post: #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.
find quote
jfcarroll Offline
Team-XBMC Developer
Posts: 453
Joined: Dec 2006
Reputation: 3
Location: Philadelphia area, US
Post: #3
This is *probably* resolved - depending on whether or not I guessed right about what the problem is.
find quote
jfcarroll Offline
Team-XBMC Developer
Posts: 453
Joined: Dec 2006
Reputation: 3
Location: Philadelphia area, US
Post: #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.
find quote
mazkolain Offline
Senior Member
Posts: 118
Joined: Mar 2012
Reputation: 13
Post: #5
The fix works perfectly. Thank you!
find quote