WIP Media importing and library integration (UPnP, Emby, Plex, ...)
(2021-10-02, 20:06)Montellese Wrote:
(2021-10-02, 16:05)enen92 Wrote: Can someone share what the blocking issue in Kodi/python3 is referred on above comments? I might be living under a rock Smile
TBH I don't know that much about it either. At first I thought it was a media import related problem. But @sualfred mentioned to me that the same happens with his skins which use a lot of add-ons in Kodi Matrix. The problem seems to be that if too many Python sub-interpreters are running at the same type Python is unable to properly handle catching exceptions with a specific type. So if some code tries to catch a TimeoutError it will not be caught. If the same code would try to catch any exception it would work even though the thrown exception is of type TimeoutError. See e.g. this workaround which solves the issue but obviously is very ugly: https://github.com/Montellese/mediaimpor...d15fa6a9d3. And a Python add-on cannot control every exception being thrown / caught because lots of libraries / modules depend on proper exception handling.

I did some debugging on Windows with media import and noticed that the problem only appears if the number of sub-interpreters running concurrently is greater than 4 and even. Each media importer add-on runs two service scripts and at least one on-demand script. If I only have one media importer add-on active everything is peachy but if I run two media importer add-ons I run into these issues all the time. If I run an additional add-on which uses a service everything is fine again because most of the time the number of concurrently running sub-interpreters is odd (2 + 2 + 1).

I thought it might have something to do with the locking in our PythonInterpreter and tried to improve it but it didn't help.
@enen92 @Montellese I understand the above prevented finally PRing this WONDERFUL, BEAUTIFUL, LIFE-CHANGING work to Master. I'm living under the rock, too. In fact, it seems I'm living under many rocks, this very earth, on a different planet. Did anything come out of your discussion above or was it a dead end, PLEASE?   ;-)
Server: DIY NAS w/ i3-8100, 32GB RAM, 4x6 TB WD Red, DD Cine S2 + 3xDuoFlex, OMV w/ Emby, TVheadend, Oscam
Living Room: Odroid N2 w/ CE, Panasonic DP-UB9004, NAD 758v3, LG OLED 65 B7, L/R B&W CM10, B&W C S2, B&W ASW10 CM, SL/SR Elac WS 1445, HL/HR Dali Alteco C1
Library: RPi2B w/ LE, Xbox One X w/ Kodi, Nintendo Switch, Panasonic Viera TX-P50 Plasma​​
Reply


Messages In This Thread
Unexpected Behaviour - by LongMan - 2015-04-20, 23:53
RE: Media importing and library integration (UPnP, Emby, Plex, ...) - by M4tt0 - 2021-12-06, 21:52
20.2 Generic Builds - by LongMan - 2023-07-20, 04:49
Logout Mark Read Team Forum Stats Members Help
Media importing and library integration (UPnP, Emby, Plex, ...)10