Re: [ServiceWorker] What is the "Doom Installing Worker" algorithm supposed to be doing? (#847)

As you say, Doom Installing Worker seems to try to abort installation/registration jobs if a new register job gets queued before the existing one completed. As such it is invoked both when running a job and when a new job is queued. I'm not sure if any of this is technically racy though (at least not anymore than the entire job queuing mechanism with only implied locking is; "schedule job" can run in parallel with "finish job" just as well).

Step 12 in the [install](https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#installation-algorithm) algorithm seems to deal with what happens when Doom Installing Worker is executed in parallel (it aborts the rest of the steps without "finishing" the job, since the job has already been finished by Doom Installing Worker).

I do agree that it would be nice to somehow make this easier to understand, although I'm not sure how best to specify how an existing register job should be aborted when a new different register job is scheduled. Moving Doom Installing Worker to inside "register" wouldn't entirely solve it. Maybe we can replace the mentioned step 12 in the install algorithm with some check to see if a new register job got queued in the meantime, but that would still be just as racy without making explicit locking guarentees around the job queue.

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/slightlyoff/ServiceWorker/issues/847#issuecomment-197016690

Received on Tuesday, 15 March 2016 20:59:09 UTC