jellyfin / jellyfin-roku

The Official Roku Client for Jellyfin
https://jellyfin.org
GNU General Public License v2.0
419 stars 128 forks source link

Crash in HomeRows.brs - Too many task threads #1072

Open cewert opened 1 year ago

cewert commented 1 year ago

roku.com crashlog report

Software Versions

Jellyfin Server Version: N/A Roku Client Version: v1.6.3

Error Text

Function updatenextupitems() As Void file/line: pkg:/components/home/HomeRows.brs(294)

https://github.com/jellyfin/jellyfin-roku/blob/master/components/home/HomeRows.brs#L294

Backtrace

Too many task threads (runtime error &h29) in pkg:/components/home/HomeRows.brs(292) 

Backtrace: 
#0 Function updatenextupitems() As Void file/line: pkg:/components/home/HomeRows.brs(294) 

Local Variables: 
global Interface:ifGlobal m roAssociativeArray refcnt=2 count:8 
itemdata roArray refcnt=1 count:24 
homerows roSGNode:ContentNode refcnt=1 
nextuprowindex Integer val:2 (&h2) 
row roSGNode:HomeRow refcnt=1 
itemsize roArray refcnt=1 count:2 
item roSGNode:HomeData refcnt=2 
continuerowindex <uninitialized> 
userconfig roAssociativeArray refcnt=1 count:14 
filteredlatest roArray refcnt=3 count:238 
lib roSGNode:HomeData refcnt=2 
loadlatest roSGNode:LoadItemsTask refcnt=1 
metadata roAssociativeArray refcnt=1 count:2

Additional context

Roku has a soft limit of 50 concurrent threads and a hard limit of 100 threads.

Task threads that have properly terminated and are no longer running will not count towards the limit, even if the task object itself is still valid (for example, the state is stopped or done).

https://developer.roku.com/docs/developer-program/core-concepts/threads.md#thread-limits

cewert commented 1 year ago

At first look this seems to be caused by users with giant libraries and not necessarily a bug. I think we just need to respect the 50 concurrent threads limit

cewert commented 1 year ago

another one in this file:

Error Text

Function getrowindex(rowtitle As String) As Dynamic file/line: pkg:/components/home/HomeRows.brs(390)

https://github.com/jellyfin/jellyfin-roku/blob/master/components/home/HomeRows.brs#L390

Backtrace

'Dot' Operator attempted with invalid BrightScript Component or interface reference. (runtime error &hec) in pkg:/components/home/HomeRows.brs(390) 

Backtrace: 
#1  Function getrowindex(rowtitle As String) As Dynamic file/line: pkg:/components/home/HomeRows.brs(390) 
#0  Function updatecontinueitems() As Void file/line: pkg:/components/home/HomeRows.brs(190) 

Local Variables: 
rowtitle         String (VT_STR_CONST) val:"Continue Watching" 
global           Interface:ifGlobal m                roAssociativeArray refcnt=3 count:7 
rowindex         Invalid i                Integer val:1 (&h1) 
tmprow           <uninitialized>