-
Notifications
You must be signed in to change notification settings - Fork 0
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
MF-464: Explictly remove cache keys that come from InvalidResponseCodeException #105
Conversation
@@ -802,6 +808,10 @@ internal class ExoPlayerPlaybackEngine( | |||
|
|||
var errorMessage = "${error.errorCodeName}: ${crawler?.message}" | |||
while (crawler?.cause != null) { | |||
@Suppress("MagicNumber") | |||
if ((crawler as? InvalidResponseCodeException)?.responseCode == 416) { | |||
playerCache.cache.removeResource(crawler.dataSpec.key!!) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the dataSpec key in question is not in the cache and hence why the player made a request to fetch it. And the request failed with 416 because it used invalid cached range data. I'm not sure how the range data is calculated but I suspect it's from the rest of the cached chunks of the track. So, I suggest we remove all resources related to this media track from the cache. In this PR, we are removing /mediatracks/Gi...QQ/34.mp4
, but let's remove all /mediatracks/Gi...QQ/*.mp4
.
Or alternatively to first validate this fix, we can simply remove all keys from the cache (kinda like a reset) and see if this solves this issue. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if our average user would notice that we wipe their entire online playback cache, so we could do that yeah. The other option is probably enough too, but it might be a little more risky since we'd have introduce some regex and make assumptions about how things can look.
Let's go with wiping the entire cache?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, let's do that 👍🏻
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there we go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great - I just pushed a small commit just to make onPlayerError
not to grow more.
2f9ad02
to
74d6a05
Compare
…eException This involves some changes to cache management since it used to live on a lower scope.
74d6a05
to
7e18310
Compare
This involves some changes to cache management since it used to live on a lower scope.