umbrellaplug / umbrellaplug.github.io

Umbrella Kodi Addon Official
111 stars 17 forks source link

[BUG] Force Trakt Sync not fully completing (?) - Apple TV #374

Open AdeHub opened 4 days ago

AdeHub commented 4 days ago

Bug

Hi

Force Trakt Sync runs and gives a completed message but is leaving (most of) the shows as unwatched, the episodes look ok

Looks to be an Apple TV issue as I can't replicate elsewhere

Expected Result

Force Trakt Sync to run successfully

Steps To Reproduce

Force Trakt Sync Refresh/Reboot Kodi Progress Shows widget now showing majority of shows as unwatched although individual episodes are ok

Kodi Version, Type of Device, Logs, Screenshots, and Additional Info

20.1 Apple TV

See logs, can't start new thread error, possibly similar to https://github.com/umbrellaplug/umbrellaplug.github.io/issues/347#issuecomment-1938194329

https://paste.kodi.tv/aduvoyanuf

Checklist

umbrellaplug commented 4 days ago

Seems to be an issue with your setup. Unable to duplicate.

AdeHub commented 2 days ago

Thanks for taking a look, will investigate further when I get some time

umbrellaplug commented 2 days ago

Seems like an issue with threading in the Python version that's being used with kodi on appletv.

AdeHub commented 1 day ago

Put this bit of code in to investigate:

log_utils.log('Num threads to process: %s' % str(len(threads)), level=log_utils.LOGDEBUG)

#[i.start() for i in threads]

for i in threads:
    waiting_for_threaded_resources = True
    while waiting_for_threaded_resources:
        try:
            i.start()
            waiting_for_threaded_resources = False
        except threading.ThreadError:
            log_utils.log('Exception: Num threads active: %s' % str(threading.activeCount()), level=log_utils.LOGDEBUG)
            control.sleep(3000)

Force Trakt Sync:

[2024-06-28 09:25:10] [ plugin.video.umbrella: DEBUG ]: Num threads to process: 321
[2024-06-28 09:25:31] [ plugin.video.umbrella: DEBUG ]: Exception: Num threads active: 81
[2024-06-28 09:25:53] [ plugin.video.umbrella: DEBUG ]: Exception: Num threads active: 83

Scrape with all Providers:

[2024-06-28 09:07:06] [ plugin.video.umbrella: DEBUG ]: Num threads to process: 61
[2024-06-28 09:07:07] [ plugin.video.umbrella: DEBUG ]: Exception: Num threads active: 99

Seems to fail when > 80 active threads