Closed Bug 976608 Opened 7 years ago Closed 6 years ago
Cache corrupted due to concurrent updates running (should coalesce)
Note: This is about the cache used by <html manifest="manifest.appcache">. Excuse me if it's not appropriate here (we considered Core:Networking:Cache and Toolkit:Download Manager). Move as needed, please. Thank you very much. After updating the manifest for an already cached app, I can trigger a "download process" by navigating to a resource which is part of the applicationCache. During the download I can navigate to other resource, part of the same manifest. A second "download process" starts (I can see both in the httpd log). If the "download process" fails (due to connectivity lost, for example) at the wrong time, the applicactionCache gets corrupted. The atomicity of the process is not honored and some files are cached incompletely. So, the app fails to work appropriately. The atomicity is an essential part of the applicacionCache, so I think this should never happen. Also, the second "download process" is a waste of bandwidth. Maybe a fail in the second "download process" is needed to trigger the bug. During my tests, a fail on the first one doesn't seems to be problematic. I can reproduce this on Firefox 27.0.1 (windows) desktop and saw it on the wild in Firefox 26 for Android. As a test, I tried on an old Iceweasel 16.0.1 (linux) desktop and fails too, so this seems old.
Is this relevant? https://mxr.mozilla.org/mozilla-central/source/dom/src/offline/nsDOMOfflineResourceList.cpp 385 // XXX: This is a race condition. remove() is specced to remove 386 // from the currently associated application cache, but if this 387 // happens during an update (or after an update, if we haven't 388 // swapped yet), that remove() will be lost when the next update is 389 // finished. Need to bring this issue up.
There is a code to coalesce appcache updates. I know it has a flaw. This should not be that hard to fix.
Assignee: nobody → honzab.moz
Summary: applicationCache corrupted → applicationCache corrupted due to concurrent updates running (should coalesce)
This is not a small change and could cause more harm than good. We'll see... https://tbpl.mozilla.org/?tree=Try&rev=1add269a0b95
Attachment #8453646 - Flags: review?(jduell.mcbugs)
Comment on attachment 8453646 [details] [diff] [review] v1 Review of attachment 8453646 [details] [diff] [review]: ----------------------------------------------------------------- Looks right.
Attachment #8453646 - Flags: review?(jduell.mcbugs) → review+
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla33
You need to log in before you can comment on or make changes to this bug.