[whatwg] Race condition in application cache obsoleting

Alexey Proskuryakov ap at webkit.org
Mon Apr 19 12:07:20 PDT 2010


There seems to be a race condition in how application cache groups are  
marked obsolete. Consider the following scenario:

1. A document is loaded from server, an appcache is fully created.
2. Appcache update is initiated (e.g. by calling  
DOMApplicationCache.update()).
3. A new document is loaded, whose main resource comes from this  
appcache.
4. Update started at step 2 fails, because manifest is 404. Appcache  
is marked obsolete.
5. The new document is being parsed, and the parser finds manifest  
declaration.
6. Parser invokes application cache selection algorithm.
7. The application cache selection algorithm associates the document  
with obsolete appcache, because it was loaded from this appcache.

But at the same time, according to downloading or updating an  
application cache algorithm, "the [obsolete] cache group no longer  
exists for any purpose other than processing of Document objects  
already associated with an application cache in the cache group.

Which part of the spec wins?

- WBR, Alexey Proskuryakov



More information about the whatwg mailing list