The download manager got stuck in a persistent infinite loop

Issue description:

The issue I’ve encountered is the download queue being stuck in some kind of loop that persisted through app restarts. The queue would scroll through dozens of files a second, with the same files eventually appearing over and over again. The original source of the files was a local Emby server.

This issue may originate from when I was on a previous app version and attempted to add a playlist to offline cache. At the time, nothing happened, so I kept trying, but the download queue was always empty. After adjusting a number of settings to no avail, and downloading a few albums or artists individually (that worked fine, it was the full playlist download which didn’t), I realized an update was available. When I updated the app and tried the playlist download again, it started working, chugging through the downloads just fine, each taking a few seconds while the server transcoded them.

Some time later I looked back at my phone and it was blitzing through long lists of songs it had already downloaded. My first thought was, “Oh, those previous attempts were still invisibly queued, and now it’s getting to parts of the queue that it’s already downloaded and skipping the duplicates,” and thought little of it, but after a few minutes it became clear it was in a loop and wasn’t stopping.

The Pause and Clear Queue buttons had no effect. At this point, I turned on the logs before continuing to attempt to resolve the issue. The “Cleanup internal states” option in the advanced settings seemed to clear out some of the queue, but not all of it. Selecting individual entries in the queue for removal would work, but an identical entry would immediately reappear. At the last point before resolving it, the download queue had 3 songs constantly showing an HTTP 500 error and instantly retrying, reappearing whenever I removed them individually.

I checked on the log file size after just a couple of minutes of trying to resolve the issue and found it had already grown to several hundred megabytes, so I stopped it there so my storage wouldn’t fill up.

Later, some combination of hitting the Pause or Clear Queue buttons, tapping “Cleanup internal states” in Advanced Settings, and force-quitting the app multiple times seems to have finally stopped the loop, allowing me to clear out the queue one by one without the items returning. I didn’t think of recording video until I’d resolved the issue, but the debug log will probably tell enough of the story.

Let me know if there’s anything else I need to provide.

Logs:

debug-20230403_101928.zip (9.5 MB)

1 Like

Ok so yes this is “relatively” normal :frowning:

Playlist downloads are expanded to an actual list of songs at the moment of the download, so what you cancel are the actual songs being downloaded, but this does not cancel the next queue of the playlist.

So what happened was a long list of playlist DLs queued, you cancel during expanding so you cancel what is already expanded, but the playlist can still be expanding so the rest of the playlist keep expanding.
Then the next playlist queue start to expand …

This should have not happened but playlist expanding was broken for like 24h :frowning:

TD;DR thanks for the detailed report, but there’s not much that I can do easily, and it should not happen again.

1 Like