-
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
LRUCacheEvictor spins, causing it to lock the SimpleCache #3260
Comments
What should happen is that there should be some sort of error fall back for the LeastRecentlyUsedCacheEvictor, and if removal fails, then it should move onto the next piece to remove instead of constantly trying the same span. I believe that what happens is that during the cache eviction process, if there's a IOException in index.store(), then that prevents the CacheEvictor from getting notified that a span got removed, even though the CacheContentIndex has already removed it. |
@erdemguven - I guess |
facing simillar issue.
|
…Span This fixes infinite loop in LeastRecentlyUsedCacheEvictor.evictCache when index store fails. Also made CachedContentIndex not final so it can be mocked and added a package protected SimpleCache constructor so mock index can be injected. Issue: #3260 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=169249517
This is fixed in |
…Span This fixes infinite loop in LeastRecentlyUsedCacheEvictor.evictCache when index store fails. Also made CachedContentIndex not final so it can be mocked and added a package protected SimpleCache constructor so mock index can be injected. Issue: #3260 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=169249517
…Span This fixes infinite loop in LeastRecentlyUsedCacheEvictor.evictCache when index store fails. Also made CachedContentIndex not final so it can be mocked and added a package protected SimpleCache constructor so mock index can be injected. Issue: #3260 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=169249517
Issue still occurs on r2.5.3. It still spins, trying to remove a span that isn't there. Issue should probably be reopened. |
I don't really see how this can happen, so I think you need to figure out a better way to analyze what's going on if we're to make any progress here. Given our own apps don't experience this problem, I suspect it's something wrong with your application code (possibly because certain things aren't well enough documented on the ExoPlayer side). Some common pitfalls that I could see causing this issue:
|
Thanks for the follow up. After some analysis on our end, it turned out to be exactly what you thought, with multiple SimpleCache instances occurring. Hasn't reoccurred after fixing that issue. |
Issue description
LeastRecentlyUsedCacheEvictor.java:evictCache() spins forever, because it tries to remove an item that's no longer contained inside the cache. That is, the LRUCacheEvictor has spans that it tries to evict, but those spans are not inside CachedContent.
Since the eviction happens from within a synchronized thread, any other threads also block until this evict completes (never). Thus, all loading is blocked forever until the app dies.
Reproduction steps
Unknown. I have an app that has many videos in a recyclerview, but I'm unsure how this particular issue arises. The only obvious information is that the cache must be filled and then try to load a new video that goes into the eviction death loop.
Version of ExoPlayer being used
2.5.1
Device(s) and version(s) of Android being used
Various devices, on android 6 and 7.
A full bug report captured from the device
bugreport-NRD90U-2017-09-12-22-30-48.zip
stacktrace.txt
The text was updated successfully, but these errors were encountered: