Skip to content
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

Offline download progress stuck when exceed 10% of free storage on Android #747

Closed
nampdn opened this issue Apr 3, 2017 · 9 comments
Closed
Labels
status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Milestone

Comments

@nampdn
Copy link

nampdn commented Apr 3, 2017

  • What version of Shaka Player are you using?
    2.0.6

    • Can you reproduce the issue with our latest release version?
      Yes
    • Can you reproduce the issue with the latest code from master?
  • Are you using the demo app or your own custom app?
    My custom app

    • If custom app, can you reproduce the issue using our demo app?
      Yes
  • What browser and OS are you using?
    Chrome Android, Crosswalk.
    Android 6

  • What did you do?
    I can use the offline feature to store the media content. It has no problem when I store any content that the total size less than ~400mb. The store process will stuck when the device exceed that size without throwing any error. By the way, my device has about 4GB free storage.

    • What content did you load?

      • If standard demo asset, which one?

      • If custom asset, what manifest and license server URIs?

    • How did you interact with the content, if at all?

  • What did you expect to happen?
    Throw some error when the downloading process can't store the content any more.

  • What actually happened?
    The download process get stuck without any error happened.

@nampdn nampdn changed the title Offline download progress stuck when exceed amount of storage on Android Offline download progress stuck when exceed 10% of free storage on Android Apr 3, 2017
@joeyparrish joeyparrish added the type: bug Something isn't working correctly label Apr 3, 2017
@joeyparrish
Copy link
Member

Thanks for the report! We'll look into it.

@joeyparrish joeyparrish added this to the v2.2.0 milestone Apr 3, 2017
@vaage vaage self-assigned this Apr 10, 2017
@vaage
Copy link
Contributor

vaage commented Apr 10, 2017

I have been able to repo this using a Pixel XL running Android 7 (N) and Chrome 57.

Since I did not have a single large piece of content, I was able to repo this by download each piece of test content. It finally froze at 43% on "Tears of Steel (external text)".

Considering I still have over 15 GB free on this device, I do not think this has to do with any relative storage capacity, but something specific about the amount of content we are storing.

@vaage
Copy link
Contributor

vaage commented Apr 12, 2017

Using "navigator.webkitTemporaryStorage.queryUsageAndQuota" on Android Chrome I have been able to confirm that we are reaching the max storage allotted to us. I am still looking into where the failure is and why we are not getting the error message.

@nampdn
Copy link
Author

nampdn commented Apr 26, 2017

hi @vaage, that's right, it is about the "total size" of content we are storing.
Any update for this?

@vaage
Copy link
Contributor

vaage commented Apr 26, 2017

Hello @phamduongnhatnam , Thanks for checking in on this again. I am still working on this but got a little side-tracked with another task. I am currently working up the stack trying to find where the failure is. Currently IndexDB always succeeds and there are never any dangling inserts left open - so the failure has to be somewhere else.

@vaage
Copy link
Contributor

vaage commented May 1, 2017

Hello @phamduongnhatnam , Good news we found the problem and it is something we can and will fix. Just so you know the full story. The hang was caused because the transaction never called oncomplete or onerror. What we overlooked was that it is possible for a transaction to call onabort. It appears that when store.put cannot write to disk the request will call onsuccess but the transaction will call onabort.

We will be updated our code so that if the transaction is aborted it will appear as an error to Shaka Player and should surface the same as any other error.

Thanks again for finding this and being patient while we looked into it.

joeyparrish pushed a commit that referenced this issue May 8, 2017
On android the quota for offline content is much smaller than on
desktop. It was observed that when this quote was exceeded that
downloading offline content would stall but not throw and error.
It was found that instead of an error, IndexDB called onabort for
the transaction.

To fix this we now route onabort through the same code path as
onerror so that the abort will be treated and communicated as an
error back to the application.

Closes #747

Change-Id: I10d536a4edc29d51790f0588f6163a5d83eccf33
@nampdn
Copy link
Author

nampdn commented May 9, 2017

Thanks @vaage and @joeyparrish, your works are awesome!

@joeyparrish
Copy link
Member

This fix is being cherry-picked to v2.1.1.

joeyparrish pushed a commit that referenced this issue May 10, 2017
On android the quota for offline content is much smaller than on
desktop. It was observed that when this quote was exceeded that
downloading offline content would stall but not throw and error.
It was found that instead of an error, IndexDB called onabort for
the transaction.

To fix this we now route onabort through the same code path as
onerror so that the abort will be treated and communicated as an
error back to the application.

Closes #747

Change-Id: I10d536a4edc29d51790f0588f6163a5d83eccf33
@joeyparrish
Copy link
Member

Also cherry-picked to v2.0.9.

@shaka-project shaka-project locked and limited conversation to collaborators Mar 22, 2018
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Apr 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Projects
None yet
Development

No branches or pull requests

4 participants