mattttvaughn / chronicle

GNU General Public License v3.0
216 stars 58 forks source link

Library Fetching is not Paged, Causing Out of Memory Server Crashes #33

Closed pmayeur closed 2 years ago

pmayeur commented 2 years ago

Crash was caused by Chronicle asking for list all tracks in the audiobook library without using any paging parameters - so a response containing details of 67093 tracks crashed the server when it ran out of memory putting the response together

Requests for this end point GET /library/sections/xxx/all need to be paged giving container size requested and the start index for the portion requested - normally client apps request library contents with 12 or 50 or 100 at a time max

Further, requests are doubled up

Feb 15, 2022 21:41:56.458 [18288] DEBUG - Request: [192.168.1.254:49900 (Subnet)] GET /library/sections/17/all?type=10 (57 live) TLS GZIP Signed-in Token (USERNAME) Feb 15, 2022 21:41:56.682 [19996] DEBUG - Request: [192.168.1.254:50008 (Subnet)] GET /library/sections/17/all?type=10 (57 live) TLS GZIP Signed-in Token (USERNAME)

Feb 15, 2022 21:42:07.701 [18288] DEBUG - It took 20515.625000 ms to retrieve 67093 items. Feb 15, 2022 21:42:08.073 [19996] DEBUG - It took 20703.125000 ms to retrieve 67093 items.

mattttvaughn commented 2 years ago

Ah looks like a dupe of #2, but good details here, I'll add them to the ticket. If you have any comments feel free to drop em there