naf623 10 Posted July 6, 2016 Share Posted July 6, 2016 HW: Raspberry Pi 2 B OS: OpenELEC 6.0.3 (Kernel: Linux 41.18 Kodi: 15.2 Emby Add On: 2.2.10 Emby Server: 3.0.5973.0 Logs (DD.MM_HHMMSS): https://www.dropbox.com/sh/u2temtarmawdfpb/AAAj1C7pKFL_vJb-FeWR_u6Ua?dl=0 I'm getting "Library Sync Thread has exited" over and over again. You can see from the log times that I'll reboot, and it'll do it again shortly after. Eventually it seems to complete updates, but sometimes I'll spend an hour restarting again and again. Always seems to be the same error: OperationalError: database is locked Link to comment Share on other sites More sharing options...
Angelblue05 4130 Posted July 6, 2016 Share Posted July 6, 2016 I've been looking into what we can do to handle this issue gracefully. Since I'm unable to personally reproduce this issue, can you test this build and let me know if it behaves better? 1 Link to comment Share on other sites More sharing options...
naf623 10 Posted July 6, 2016 Author Share Posted July 6, 2016 So far so good with that new build. 1 Link to comment Share on other sites More sharing options...
naf623 10 Posted July 7, 2016 Author Share Posted July 7, 2016 Still seems to be working a treat. Added a bunch of new stuff, and while the update was going, messed around on Kodi. Nothing caused a crash. 1 Link to comment Share on other sites More sharing options...
Angelblue05 4130 Posted July 7, 2016 Share Posted July 7, 2016 That's really good. Thanks a lot for confirming it does help. I will keep it in mind when I make the next beta build. Sent from my iPhone using Tapatalk Link to comment Share on other sites More sharing options...
naf623 10 Posted July 7, 2016 Author Share Posted July 7, 2016 (edited) What did you change? A retry like null suggested? Its actually made Kodi feel more responsive during updates, I think... Edited July 7, 2016 by naf623 Link to comment Share on other sites More sharing options...
Angelblue05 4130 Posted July 7, 2016 Share Posted July 7, 2016 (edited) What null suggested is already being worked on, however it's not completed yet. No all I did was enable auto commit on the connection to the database, this way, we can avoid locking the database. It's not a fix, but may very well be a step in the right direction, since our database transactions are usually small. But we still have some work to do in this area. Sent from my iPhone using Tapatalk Edited July 7, 2016 by Angelblue05 Link to comment Share on other sites More sharing options...
Angelblue05 4130 Posted July 11, 2016 Share Posted July 11, 2016 @@naf623 Still holding? Link to comment Share on other sites More sharing options...
naf623 10 Posted July 12, 2016 Author Share Posted July 12, 2016 Seems to be working a treat. I did have one crash, but think other stuff was going on as well: ERROR: Exception in thread Thread-10: Traceback (most recent call last): File "/home/stephan/projects/openelec-6.0/build.OpenELEC-RPi.arm-6.0.3/Python-2.7.3/.install_pkg/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner File "/storage/.kodi/addons/plugin.video.emby/resources/lib/librarysync.py", line 900, in run self.run_internal() File "/storage/.kodi/addons/plugin.video.emby/resources/lib/librarysync.py", line 970, in run_internal librarySync = self.startSync() File "/storage/.kodi/addons/plugin.video.emby/resources/lib/librarysync.py", line 89, in startSync completed = self.fastSync() File "/storage/.kodi/addons/plugin.video.emby/resources/lib/librarysync.py", line 107, in fastSync lastSyncTime = utils.convertDate(lastSync) File "/storage/.kodi/addons/plugin.video.emby/resources/lib/utils.py", line 225, in convertDate date = datetime.strptime(date, "%Y-%m-%dT%H:%M:%SZ") ImportError: Failed to import _strptime because the import lockis held by another thread. 1 Link to comment Share on other sites More sharing options...
Angelblue05 4130 Posted July 19, 2016 Share Posted July 19, 2016 The temporary fix for the database being locked has been released with the latest beta. Note that I made it a setting (under sync options), because it effect the speed of the sync in general. I would imagine, it would extend the initial sync quite a bit, also. So best have it disabled by default. Link to comment Share on other sites More sharing options...
naf623 10 Posted August 30, 2016 Author Share Posted August 30, 2016 Wow, it certainly slows sync down significantly. Doing a reinstall and syncing my entire library from scratch, each movie takes over 10 seconds to process... No crashes, though Link to comment Share on other sites More sharing options...
Angelblue05 4130 Posted August 30, 2016 Share Posted August 30, 2016 (edited) Yeah, you don't need to have the setting enabled during the initial sync because it's unlikely something else would try to access the database at the same time. Anyway, it's only temporary, hopefully we'll get around to solidifying the process soon. So if you ever need to reset again, disable the setting first, then reset. Edited August 30, 2016 by Angelblue05 Link to comment Share on other sites More sharing options...
Recommended Posts