google / google/ExoPlayer

SimpleCache corruption debugging and cleanup

Open
#10,773 11 comments 0 reactions 1 assignee Assigned to @marcbaechinger View on GitHub
question
Dominant language
Java
Stars
21.9k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

So this is a question with multiple points around ExoPlayer simple cache.

I don't have a repro and a way to trigger the source cause of cache corruption but when it happens the player then gives:

```
Cache read: 64bc5440-66e7-4514-bad8-e14e5c795d83 - 36.0 kB/282.1 MB [B:327680-/music/King Gizzard & The Lizard Wizard/Changes/04 No Body.flac]
Error/ExoPlayer: internalError [eventTime=6444.95, mediaPos=0.00, window=1, period=1, loadError
java.io.EOFException
at com.google.android.exoplayer2.extractor.DefaultExtractorInput.readFromUpstream(DefaultExtractorInput.java:296)
at com.google.android.exoplayer2.extractor.DefaultExtractorInput.skipFully(DefaultExtractorInput.java:107)
at com.google.android.exoplayer2.extractor.DefaultExtractorInput.skipFully(DefaultExtractorInput.java:115)
at com.google.android.exoplayer2.extractor.ogg.DefaultOggSeeker.readGranuleOfLastPage(DefaultOggSeeker.java:235)
at com.google.android.exoplayer2.extractor.ogg.DefaultOggSeeker.read(DefaultOggSeeker.java:107)
at com.google.android.exoplayer2.extractor.ogg.StreamReader.readPayload(StreamReader.java:200)
at com.google.android.exoplayer2.extractor.ogg.StreamReader.read(StreamReader.java:123)
at com.google.android.exoplayer2.extractor.ogg.OggExtractor.read(OggExtractor.java:88)
at com.google.android.exoplayer2.source.BundledExtractorsAdapter.read(BundledExtractorsAdapter.java:127)
at com.google.android.exoplayer2.source.ProgressiveMediaPeriod$ExtractingLoadable.load(ProgressiveMediaPeriod.java:1039)
at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:412)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:1013)
```

The first line is details from `onCachedBytesRead` listener.
So the cache read 36k and stops instead of returning more or switching to the upstream. But there's no other information about what is happening to actually debug more.

So that would be question 1, what can make the cache only read 36k and stops without trying to use the upstream and without logging anything?

The second question is about how can I properly recover from this? This will fails every time so requires a removal of that particular dataspec from the cache, but I can't figure out how to do that, all I find is clear the complete cache and that's not something I want to do if possible.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.