Kodi Community Forum
Kodi GIT library cleaning freeze/lockup when playing nfs video - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: OS independent / Other (https://forum.kodi.tv/forumdisplay.php?fid=228)
+---- Thread: Kodi GIT library cleaning freeze/lockup when playing nfs video (/showthread.php?tid=345261)



Kodi GIT library cleaning freeze/lockup when playing nfs video - teriyaki - 2019-07-09

I'm not sure if this is Linux-specific or OS independent so I'm posting here in hopes a non-Linux user can test and report back.

So someone was watching a tv show when I accidentally sent a `kodi-send.py --action='CleanLibrary(video)'`. The library cleaning pop-up window appeared to a very displeased audience. I said, `oops my bad, just cancel it` but rather that selecting the cancel button in the popup, the "stop" button on the remote was pressed. The video stopped, along with the library cleaning, and kodi itself. Kodi had to unceremoniously be restarted while I hung my head in shame.

So, to reproduce... Start playing your favorite tv show, movie, or home video. Send a kodi-send.py --action='CleanLibrary(video)' command, probably via ssh like I do. Lastly, press the "stop" button on your remote control. You should now have a frozen Kodi. If not, then god is punishing me.

No, I didn't get the log because the WAF was decreasing too quickly and the priority was get Kodi back up. But yes, I can reproduce this and copy the log later when the tv is not in use if it's deemed necessary. For the record, I'm running self-compiled git (19.0-ALPHA1-git+97fe0eba17 amd64) on Debian Sid Linux, on an Intel NUC, with media served via nfs on a gigabit lan, and it's currently 81°F right now and I'm eating BBQ pork ribs, trying not to get sauce on the keyboard. Questions are welcome, complaints may be directs towards the nearest trash bin as this has caused me enough suffering already.

Thanks!


RE: Kodi GIT library cleaning freeze/lockup when playing nfs video - DaVu - 2019-07-09

I can at least reproduce that issue while using Ubuntu 18.04.

It would be nice if you could open an issue at: https://github.com/xbmc/xbmc/issues

So it won't get forgotten.

Thanks


RE: Kodi GIT library cleaning freeze/lockup when playing nfs video - DaVu - 2019-07-09

I debugged it a bit more and found out that Kodi will not crash if:

- clean video library and music playback
- clean music library and video playback
- clean music library and music playback

So, I would probably not call it a fix, but at least that prevents Kodi from cleaning the video library by using kodi-send -a "CleanLibrary(video)" during video playback:

https://github.com/DaVukovic/xbmc/commit/2d98eccdefefe1ac215f9a183d7494a17923e468


RE: Kodi GIT library cleaning freeze/lockup when playing nfs video - teriyaki - 2019-07-10

DaVu, thanks for having a quick look at this and writing a solution to prevent it from happening. Blocking actions that result in a crash/freeze/lockup is better than not addressing them at all! I forgot that library cleaning is done in the main loop rather than its' own thread so the potential for problems there is baked in. I'm not sure what logic that design decision was based on but as I understand things, that won't be addressed in the foreseeable future. So, if the best we can hope for is band-aids then so be it - whatever helps keep the WAF at reasonable levels. Wink


RE: Kodi GIT library cleaning freeze/lockup when playing nfs video - DaVu - 2019-07-10

I PRd it. I don't think it will be accepted because it doesn't fix the root cause (hence I said it's not a fix...that's more a workaround). But that's something for one of our core-devs which I'm not. Wink

Let's see what happens. But if you are able to compile Kodi from source, then feel free to use this patch as it doesn't hurt anything imprtant AFAICT.


RE: Kodi GIT library cleaning freeze/lockup when playing nfs video - MrTarantula - 2019-07-10

It might have a better change of being accepted if the text was added to strings.po for translation.


RE: Kodi GIT library cleaning freeze/lockup when playing nfs video - DaVu - 2019-07-11

True.Will change that.


RE: Kodi GIT library cleaning freeze/lockup when playing nfs video - teriyaki - 2019-07-11

Hopefully it will be merged considering the root issue likely won't be addressed. Although it may be more of a workaround than a fix, it prevents a known reproducible condition that results in a completely lockedup up Kodi. Something to address that is better than nothing. Generally it seems like the more stable Kodi is for the users, the better for everyone. I've already applied the patch and recompiled here but I don't know how many of the millions of Kodi users have that as an option. Whatever the result of the PR, the quick fix is greatly appreciated!


RE: Kodi GIT library cleaning freeze/lockup when playing nfs video - DaVu - 2019-07-11

@teriyaki 

I forced pushed some changes to that PR and did the changes @MrTarantula suggested. It will work for you as it was, but in case your native language isn't english and you want to see that translated, I would suggest to use the update.

I'm not sure how many users will trigger a "stop video" during a video library cleanup Wink. I could imagine that this bug exists since a VERY long time and noone ever noticed it.  So not really sure how much we might need this PR. I'm glad if it will be accepted and if not, then you have at least something to work with Wink.


RE: Kodi GIT library cleaning freeze/lockup when playing nfs video - teriyaki - 2019-07-12

I'm a native English speaker but will replace my local patch with the updated version.  I agree that it's uncommon for someone to trigger a library clean and then a `stop video`, but I managed to do it completely by accident. Another thing to consider too is that typically the vast majority of users don't participate in forums or mailing lists. For example, I hung out in a group of about 50 people who all used the same software.  Collectively we were constantly running into bugs/problems but I was the only one who took the initiative and engaged the community & developers to get things fixed. Everyone else basically would just deal with it via restarts. Kodi has millions & millions of users so even though things like this may be uncommon, I'd bet it has happened to a lot more than just me, just the other day. I dunno how many people are registered here, and of those, how many are active but it's got to be just a tiny sliver of the Kodi user base.


RE: Kodi GIT library cleaning freeze/lockup when playing nfs video - Snapcase - 2019-08-15

I've been having this problem without knowing it. In my setup when videos are automatically added to my NAS a Kodi video database update is triggered. I have the clean database on library update option turned on in advanced settings, so I have automatic library updates and cleans happening when I watch videos without user intervention. I've been getting crashes during library updates from time to time without knowing why, usually when I pause or stop. 

If a clean library is a blocking action, cleanonupdate in advancedsettings.xml and any automated library update addon, timer or external service is likely to cause problems for many users.


RE: Kodi GIT library cleaning freeze/lockup when playing nfs video - DaVu - 2019-08-16

Normally (at least from I know) the crash shouldn't be triggered while pausing a video. Only if you perform a library cleanup and stop a currently playing video at the same time the cleanup happens.

But I have to admit that I haven't thought about the "cleanonupdate" option the advancedsettings.xml provides. So my suggestion above might also avoid using that function which would be a bad idea. I'm currently re-building and see what happens.

I'm also not too sure how "cleanonupdate" works. Will have to look for that as well. As it might be important to know if both tasks are somewhat ran at the same time or if a library update is done first and if that has finished a library clean is triggered. But I'll see. Thanks for that pointer


RE: Kodi GIT library cleaning freeze/lockup when playing nfs video - Snapcase - 2019-08-17

I don't know for sure that I'm having the same crash, I'm just noticing crashes during library updates but it mostly seems to happen when I'm not paying that much attention, especially since my updates are automated. There's never anything in the kodi.log. If it happens again I'll try and grab the crash dumps. Considering how much happens during that process, it might be a scraper or add-on and have nothing to do with what you're looking into so... I also came across this issue which is also about crashes during library updates but not related to stopping video.

With the cleanonupdate setting, the clean library happens after the update. If that option is part of the issue I'd update the wiki but I don't seem to be able to. I find that option useful since I try as much as possible to have a hands-off setup and never have to do any manual library management.