W3C home > Mailing lists > Public > whatwg@whatwg.org > August 2008

[whatwg] Active workers when user leaves the page

From: Robert O'Callahan <robert@ocallahan.org>
Date: Sat, 9 Aug 2008 10:29:37 +1200
Message-ID: <11e306600808081529g45ba03cfm4360fee1cb8a899d@mail.gmail.com>
On Sat, Aug 9, 2008 at 7:01 AM, Jonas Sicking <jonas at sicking.cc> wrote:

> I do want to be agressive with killing workers when the user leaves a page
> since that makes for better user experience. However I'm also worried about
> stopping scripts halfway through breaking things and leaving the site with
> half-finished operations that are stored in databases or localStorage.
>

Aggressive killing of workers without warning when the user navigates away
would actually be a good feature.

There are various reasons outside anyone's control that a worker might die
abruptly. For example, power failure, browser crash, or "slow-script" style
timeout. Applications need to be able to handle those cases, for example by
using database transactions or careful use of atomic operations. But that's
hard to test and authors probably won't design or test well for those cases
since they're relatively uncommon. Expanding abrupt termination scenarios to
include navigate-away makes abrupt termination much easier to test, forces
authors to design for it early, and will ultimately simplify the application
design by reducing the different ways a worker can terminate.

This may sound a bit radical, but it's not a new idea. It's a principle
sometimes called "crash-only software". See e.g.
http://www.usenix.org/events/hotos03/tech/full_papers/candea/candea_html/

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/20080809/3f02c0c0/attachment.htm>
Received on Friday, 8 August 2008 15:29:37 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:04 UTC