-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DownloadManager task sync creates too many concurrently-running threads for moderate amounts of STATE_RESTARTING or STATE_REMOVING downloads in index #10458
Comments
Thanks for the detailed bug report!
That sounds likely, and yes, capping it is probably a good idea. I don't think there needs to be a setter to configure the value; we probably just need to pick a suitable value internally (which might be |
I would suggest you solve the problem in the simplest way possible, which is probably to keep Switching |
sure thing |
@stoyicker - Thanks! We will await a pull request. Reassigning to @marcbaechinger who will probably be the person to review it once it's available. |
@ojw28 The PR is open already, but it's on the media3 repo, as I opened another (unrelated) one here a few days ago was asked to take it there instead, so I assumed the same would apply for this one. Do you want me to open it here instead? |
Ah, that's fine, thanks! Reassigning to @tonihei in that case, since the PR is assigned to him. |
ExoPlayer Version
2.18.0
Devices that reproduce the issue
Pixel 2 emulator API 31
TCL 10 SE TCL UI 3.0.7.K2V (API 30)
Devices that do not reproduce the issue
None found
Reproducible in the demo app?
Yes
Reproduction steps
Simple setup:
DownloadManager
with this index.Demo app setup:
Make sure you always uninstall the app or clear its data when trying anew to avoid picking up the old index. Also note that this applies not only on initialization, but on any calls that trigger a call to
syncTasks
with the appropriate amount of downloads in the problematic states.Expected result
Simple setup:
When the
DownloadManager
is initialized (as in, theactiveTask
map filled because of thesyncTasks
call ininitialize
has been emptied, not when the callback has been invoked), the screen will change to blue, so it is expected that after a few seconds this happens.Demo app setup:
The app continues to run after 30s of wait (starting after the list has been drawn).
Actual result
Simple setup:
You never get to the blue screen. Instead, the app crashes with the exception below.
Demo app setup:
It crashes because of the exception below.
Example stacktrace:
I'm fairly certain this is due to the amount of tasks started from
syncRemovingDownload
not being capped, for example such as the the ones fromsyncQueuedDownload
which are capped by the amount of parallel downloads. I was thinking of drafting a solution whereTask
is changed to extendRunnable
instead ofThread
and then a new setter is introduced, akin to that for max parallel downloads, to control the amount of threads in an executor that we submit tasks to, but wanted to run the issue by you before. Note that I understand that 2k may seem a large amount of items to have removing, but I don't think it is a justification to consider this a corner-case given that not only does it reproduces consistently in an unrealistically simple app, but also in the demo app (which setslargeHeap
to true) with a not-much-higher-number.Media
N/A
Bug Report
adb bugreport
to dev.exoplayer@gmail.com after filing this issue.The text was updated successfully, but these errors were encountered: