-
Notifications
You must be signed in to change notification settings - Fork 416
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
Cache remove bug #1906
Comments
Hi @Caij, Could you please send the bug report again as I didn't see it in our mailbox? Also, could you please provide a detailed steps that can reliably reproduce the issue? I couldn't repro the issue by simply playing/downloading media until the cache exceeds the By just looking at the mentioned logic, I didn't see how the loop Lines 73 to 75 in df887a9
removeEmpty in the initialize() method.
As suggested from its name, media/libraries/datasource/src/main/java/androidx/media3/datasource/cache/SimpleCache.java Lines 700 to 702 in df887a9
LeastRecentlyUsedCacheEvictor should already be added media/libraries/datasource/src/main/java/androidx/media3/datasource/cache/SimpleCache.java Lines 693 to 695 in df887a9
There might be some corner case that I overlooked, but I think a real repro can only help to investigate here. |
There is another way to reproduce this issue:
|
Version
Media3 1.4.0
More version details
SimpleCache.initialize
initialize -> loadDirectory -> SimpleCacheSpan create -> addSpan -> notifySpanAdded -> LeastRecentlyUsedCacheEvictor.onSpanAdded -> leastRecentlyUsed.add(span)
ContentIndex.removeEmpty
SimpleCache.initialize -> ContentIndex.removeEmpty -> if have empty content, This content will be deleted.
LeastRecentlyUsedCacheEvictor.evictCache, the Cache removeSpanInternal has been return, so
while (currentSize + requiredSpace > maxBytes && !leastRecentlyUsed.isEmpty())
Unable to end.eg: span file ha deleted, ContentIndex emoty
Devices that reproduce the issue
any
Devices that do not reproduce the issue
No response
Reproducible in the demo app?
No
Reproduction steps
1 play media
2 When the cache is full
Expected result
the cache remove success
Actual result
the cache remove fail
Media
none
Bug Report
adb bugreport
to android-media-github@google.com after filing this issue.The text was updated successfully, but these errors were encountered: