Closed
Bug 1319334
Opened 8 years ago
Closed 8 years ago
Intermittent dom/workers/test/serviceworkers/test_bug1151916.html | Test timed out.
Categories
(Core :: DOM: Service Workers, defect)
Core
DOM: Service Workers
Tracking
()
RESOLVED
FIXED
mozilla53
Tracking | Status | |
---|---|---|
firefox51 | --- | unaffected |
firefox52 | --- | unaffected |
firefox53 | --- | fixed |
People
(Reporter: intermittent-bug-filer, Assigned: catalinb)
References
Details
(Keywords: intermittent-failure)
Attachments
(1 file)
4.06 KB,
patch
|
bkelly
:
review+
|
Details | Diff | Splinter Review |
Filed by: philringnalda [at] gmail.com https://treeherder.mozilla.org/logviewer.html#?job_id=6996546&repo=autoland https://queue.taskcluster.net/v1/task/LrRQpPicQ4qBWnkhKRHv2A/runs/0/artifacts/public/logs/live_backing.log
Assignee | ||
Comment 1•8 years ago
|
||
This may be another case where we GC a SW instance while waiting for 'statechange' events. I think I managed to reproduce this locally by spamming SpecialPowers.exactGC().
Assignee: nobody → catalin.badea392
Assignee | ||
Comment 2•8 years ago
|
||
After debugging this further, the problem is when the iframe waits for the worker to become "activated". The test waits for navigator.serviceWorker.ready to resolve then waits for reg.active.state to become 'activated' using the 'statechange' event. The problem is that we resolve the ready promise before transitioning the registration's state properties. So we end up doing this: 1. set mActiveWorker to new worker 2. queue registration change ( .waiting -> .active) - TransitionWaitingToActive(); 3. queue state change (activating) - TransitionWaitingToActive(); 4. SWM->CheckPendingReadyPromises(); At this point, swInfo->mActiveWorker is non-null, thus we will resolve the pending ready promise. 5. Pending ready promise then callback: here the test will add an event listener using reg.active.onstatechange 6. The runnable queued at step 2 executes and it will set registration.active to registration.waiting. This will actually clear our reference because, registration.active is non-null because it was accessed when the pending promise's then-callback was executed, while registration.waiting is null. 7. Cycle collect FTW 8. We never get the 'activated' event.
Assignee | ||
Comment 3•8 years ago
|
||
Attachment #8813197 -
Flags: review?(bkelly)
Comment 4•8 years ago
|
||
Comment on attachment 8813197 [details] [diff] [review] Resolve ready promise *after* updating registration.state properties. Review of attachment 8813197 [details] [diff] [review]: ----------------------------------------------------------------- LGTM, but please write a spec issue and flag it as v1 milestone. Section 3.4.2 still says: > 3. If registration’s active worker is null, wait until registration’s active worker changes. >> Implementers should consider this condition is met when the corresponding registration request gets to the step 6 of Activate algorithm. This isn't quite right now that step 6 of Activate queues a task to perform the work.
Attachment #8813197 -
Flags: review?(bkelly) → review+
Assignee | ||
Comment 5•8 years ago
|
||
Filed https://github.com/w3c/ServiceWorker/issues/1011 - can't set the milestone, though.
Keywords: checkin-needed
Pushed by ihsiao@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/1dcdef45d753 Resolve ready promise *after* updating registration.state properties. r=bkelly
Keywords: checkin-needed
Comment 7•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/1dcdef45d753
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox53:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
Updated•8 years ago
|
You need to log in
before you can comment on or make changes to this bug.
Description
•