[whatwg] RFC: Alternatives to storage mutex for cookies and localStorage

On Sun, Sep 6, 2009 at 4:55 AM, Chris Jones <cjones at mozilla.com> wrote:

> I mean prevent the UA from affecting a script's execution.  The cases I've
> thought of so far where we will probably have to break storage-mutex
> semantics are
>
>  * clear private data
>
 * close tab
>  * quit UA
>

I think these could appear to complete immediately while doing their work
asynchronously in the background, given the assumption that content script
execution time is bounded (if it takes "too long" we enforce the assumption
using the slow-script timeout).

 * "slow script" timeout
>  * store-to-disk failure
>  * crash
>
>
In HTML5 we generally take the approach that if a UA is unable to satisfy
spec semantics due to resource limits or other problems in the environment,
then it's OK to deviate from the spec. Applying that principle here, we
would not need to provide database consistency in the presence of these
failures.

And as I argued in the OP, I think localStorage should be designed only with
> sites like gmail in mind.
>

Yes ... I'm not so sure about that.

I'm beginning to think that this discussion is more about DB consistency
> than multi-event-loop UAs.  I think it's telling that all of the cases I
> listed above could arise in single-process Gecko except "clear private data"
> (and maybe "close tab", not sure).
>

Currently in Gecko "clear private data", "close tab" and "quit" would all
wait for running scripts to complete. But indeed, the consistency you want
isn't provided by any browser today if the app encounters resource limits or
hardware failures. Storing a single key-value pair should be atomic in the
case of failure, so apps have to roll-your-own consistency and recovery
using that.

Rob
-- 
"He was pierced for our transgressions, he was crushed for our iniquities;
the punishment that brought us peace was upon him, and by his wounds we are
healed. We all, like sheep, have gone astray, each of us has turned to his
own way; and the LORD has laid on him the iniquity of us all." [Isaiah
53:5-6]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20090906/9419df39/attachment.htm>

Received on Saturday, 5 September 2009 13:33:05 UTC