New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 756838 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

CacheStorage doesn't appear to attempt recovery when backend init failed.

Project Member Reported by morlovich@chromium.org, Aug 18 2017

Issue description

In issue https://bugs.chromium.org/p/chromium/issues/detail?id=756193 the reporter had trouble with their CacheStorage ops failing because the profile got corrupted and so disk_cache::CreateCacheBackend was failing. Arguably, in this case Chrome should be doing something itself (like dropping the cache). 

The easy way of doing it is to pass true to force=true to CreateCacheBackend, but that might not have the right semantics as it will only affect that one cache dir.

Easy-ish way to demo:

cache_storage.html:
<script>
caches.open("test").then(function(c) {
  c.keys().then(function(a) {
      alert("keys:" + a);
    }
  ).catch(function(e) {
      alert("exception calling keys:" + e);
    }
  );
}).catch(function(e) {
  alert("exception:" + e);
});
</script>
----
1. Run chrome with a temp/empty profile, create the cache dir:
out/Default/chrome --user-data-dir=/tmp/cr ~/cache_storage.html
(works fine)
2. Close chrome
3. Simulate corruption:
cat /dev/null > /tmp/cr/Default/Service\ Worker/CacheStorage/*/*/index
4. Run chrome again.
out/Default/chrome --user-data-dir=/tmp/cr ~/cache_storage.html
Now get an exception, and keep getting it unless someone calls CacheStorage.delete (or nukes the profile)


 
Status: Available (was: Untriaged)
Thnx for the steps to repro.

The other storage systems generally attempt to 'recover' from similar corruption by deleting the corrupt database and creating a new one. In most cases, that's a silent error, but in the case of IDB sometimes (not always) the caller is informed of the database having been recreated due to corruption.

We probably should do some form of recovery for CacheStorage too, some options:

1. Delete it and return an error code of some kind, the next attempt to open will succeed.

2. Delete and recreate empty without letting the user know anything had gone wrong.

3. Delete, recreate empty, tell the user about that having happened.

I'd vote for option 1 for the sake of simplicity.

Cc: michaeln@chromium.org
Project Member

Comment 3 by sheriffbot@chromium.org, Aug 24

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: -Hotlist-Recharge-Cold
Owner: wanderview@chromium.org
Status: Assigned (was: Untriaged)
This will be addressed as part of the backend redesign I'm working on.

Sign in to add a comment