Skip to content

LRUCacheEvictor spins, causing it to lock the SimpleCache #3260

@davidliu

Description

@davidliu

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions