Closed
Bug 1231974
Opened 9 years ago
Closed 9 years ago
Intermittent TEST-UNEXPECTED-FAIL | unregister-then-register-new-script.https.html | Registering a new script URL while an unregistered registration is in use - assert_unreached: assert_equals the new worker should control a new document
Categories
(Core :: DOM: Service Workers, defect)
Core
DOM: Service Workers
Tracking
()
RESOLVED
FIXED
mozilla46
Tracking | Status | |
---|---|---|
firefox46 | --- | fixed |
People
(Reporter: bkelly, Assigned: bkelly)
References
(Blocks 1 open bug)
Details
Attachments
(6 files, 5 obsolete files)
6.12 KB,
patch
|
baku
:
review+
|
Details | Diff | Splinter Review |
8.12 KB,
patch
|
baku
:
review+
|
Details | Diff | Splinter Review |
9.47 KB,
patch
|
baku
:
review+
|
Details | Diff | Splinter Review |
834 bytes,
patch
|
baku
:
review+
|
Details | Diff | Splinter Review |
4.25 KB,
patch
|
baku
:
review+
|
Details | Diff | Splinter Review |
17.29 KB,
patch
|
bkelly
:
review+
|
Details | Diff | Splinter Review |
This test depends on GC timing do no longer control the previous frame.
Assignee | ||
Comment 1•9 years ago
|
||
Attachment #8697602 -
Flags: review?(ehsan)
Assignee | ||
Updated•9 years ago
|
Attachment #8697602 -
Flags: review?(ehsan)
Assignee | ||
Comment 2•9 years ago
|
||
We need to examine this test case for correctness and determine what the spec should do here. There is already bug 1227007 to do that. I'm just going to disable this test for now.
Assignee | ||
Comment 3•9 years ago
|
||
Attachment #8697626 -
Flags: review?(ehsan)
Assignee | ||
Updated•9 years ago
|
Keywords: leave-open
Assignee | ||
Updated•9 years ago
|
Blocks: ServiceWorkers-compat
Updated•9 years ago
|
Attachment #8697626 -
Flags: review?(ehsan) → review+
Assignee | ||
Comment 5•9 years ago
|
||
Comment on attachment 8697602 [details] [diff] [review] Fix wpt GC timing dependency by explicitly navigating a frame to stop being a controlled client. r=ehsan A debug try to see what is going on here. I don't think my GC theory above is accurate: https://treeherder.mozilla.org/#/jobs?repo=try&revision=2f35207eecb0
Attachment #8697602 -
Attachment is obsolete: true
Comment 6•9 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/283333d47b1b
Assignee | ||
Comment 7•9 years ago
|
||
We're getting an update executed for the scope using a different registration object which then does not see the script URL has changed. This then re-activates the old script URL. Its still unclear why we are getting this new registration. It could be related to a necko channel failure that appears to be happening in the ServiceWorkerScriptCache layer for some reason.
Assignee | ||
Comment 8•9 years ago
|
||
I think we're essentially hitting the same race described in: https://github.com/slightlyoff/ServiceWorker/issues/783 We should really look up the registrations in the job Start() instead of getting our references from outside of the queue synchronization mechanism.
Assignee | ||
Updated•9 years ago
|
Attachment #8697626 -
Attachment is obsolete: true
Assignee | ||
Comment 9•9 years ago
|
||
Attachment #8698161 -
Flags: review?(ehsan)
Assignee | ||
Comment 10•9 years ago
|
||
Attachment #8698162 -
Flags: review?(ehsan)
Assignee | ||
Comment 11•9 years ago
|
||
Attachment #8698163 -
Flags: review?(ehsan)
Assignee | ||
Comment 12•9 years ago
|
||
Attachment #8698165 -
Flags: review?(ehsan)
Assignee | ||
Comment 13•9 years ago
|
||
Attachment #8698166 -
Flags: review?(ehsan)
Assignee | ||
Comment 14•9 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=43a79efc8703
Assignee | ||
Comment 15•9 years ago
|
||
Updated to fix a failure path that called Done() synchronously from a job Start(). https://treeherder.mozilla.org/#/jobs?repo=try&revision=ca2df2f85baf
Attachment #8698165 -
Attachment is obsolete: true
Attachment #8698165 -
Flags: review?(ehsan)
Attachment #8698206 -
Flags: review?(ehsan)
Assignee | ||
Comment 16•9 years ago
|
||
Try to fix that same failure case again. This time with better logic. https://treeherder.mozilla.org/#/jobs?repo=try&revision=9eee01cc54bf
Attachment #8698206 -
Attachment is obsolete: true
Attachment #8698206 -
Flags: review?(ehsan)
Attachment #8698281 -
Flags: review?(ehsan)
Assignee | ||
Updated•9 years ago
|
Keywords: leave-open
Assignee | ||
Comment 17•9 years ago
|
||
There are still a couple intermittents I want to investigate, but I think these patches should land.
Assignee | ||
Comment 18•9 years ago
|
||
So, there is still a race in the spec even after making these agreed changes: https://github.com/slightlyoff/ServiceWorker/issues/783#issuecomment-164813284 This patch allows us to abort the install job if it was triggered from an update and the newest worker script has changed on us. https://treeherder.mozilla.org/#/jobs?repo=try&revision=b12f55e91dba
Attachment #8698477 -
Flags: review?(ehsan)
Assignee | ||
Comment 19•9 years ago
|
||
Try is looking pretty good. Large number of retriggers have completed with no service worker wpt failures. This should be good to go once review completes.
Assignee | ||
Updated•9 years ago
|
Attachment #8698161 -
Flags: review?(ehsan) → review?(amarchesini)
Assignee | ||
Updated•9 years ago
|
Attachment #8698162 -
Flags: review?(ehsan) → review?(amarchesini)
Assignee | ||
Updated•9 years ago
|
Attachment #8698163 -
Flags: review?(ehsan) → review?(amarchesini)
Assignee | ||
Updated•9 years ago
|
Attachment #8698166 -
Flags: review?(ehsan) → review?(amarchesini)
Assignee | ||
Updated•9 years ago
|
Attachment #8698281 -
Flags: review?(ehsan) → review?(amarchesini)
Assignee | ||
Updated•9 years ago
|
Attachment #8698477 -
Flags: review?(ehsan) → review?(amarchesini)
Updated•9 years ago
|
Attachment #8698161 -
Flags: review?(amarchesini) → review+
Updated•9 years ago
|
Attachment #8698162 -
Flags: review?(amarchesini) → review+
Updated•9 years ago
|
Attachment #8698163 -
Flags: review?(amarchesini) → review+
Updated•9 years ago
|
Attachment #8698166 -
Flags: review?(amarchesini) → review+
Comment 20•9 years ago
|
||
Comment on attachment 8698281 [details] [diff] [review] P4 Lazy load registration and verify it does not change in service worker jobs. r=ehsan Review of attachment 8698281 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/workers/ServiceWorkerManager.cpp @@ +970,5 @@ > > + nsresult > + EnsureRegistration() > + { > + AssertIsOnMainThread(); what about if mRegistration already exist? @@ +974,5 @@ > + AssertIsOnMainThread(); > + > + RefPtr<ServiceWorkerManager> swm = ServiceWorkerManager::GetInstance(); > + if (NS_WARN_IF(!swm)) { > + mRegistration = nullptr; this should not be needed. @@ +1164,5 @@ > > void > ContinueAfterInstallEvent(bool aInstallEventSuccess) > { > + nsresult rv = EnsureRegistration(); are we sure we don't have a mRegistration here? @@ +1340,5 @@ > const nsACString& aMaxScope) override > { > RefPtr<ServiceWorkerRegisterJob> kungFuDeathGrip = this; > + > + nsresult rv = EnsureRegistration(); move it after mCanceled check @@ +1492,5 @@ > { > AssertIsOnMainThread(); > RefPtr<ServiceWorkerRegisterJob> kungFuDeathGrip = this; > + > + nsresult rv = EnsureRegistration(); move this after the if(mCanceled) check.
Attachment #8698281 -
Flags: review?(amarchesini) → review+
Updated•9 years ago
|
Attachment #8698477 -
Flags: review?(amarchesini) → review+
Assignee | ||
Comment 21•9 years ago
|
||
(In reply to Andrea Marchesini (:baku) from comment #20) > > + nsresult > > + EnsureRegistration() > > + { > > + AssertIsOnMainThread(); > > what about if mRegistration already exist? This is allowed by design. But we verify that the current registration for this scope is not a new object and clear mRegistration if it has changed. > @@ +974,5 @@ > > + AssertIsOnMainThread(); > > + > > + RefPtr<ServiceWorkerManager> swm = ServiceWorkerManager::GetInstance(); > > + if (NS_WARN_IF(!swm)) { > > + mRegistration = nullptr; > > this should not be needed. Why? I want to ensure as an invariant that if EnsureRegistration returns a failure code, then mRegistration is nullptr. If shutdown happens in the middle of the job, then I think SWM can be nullptr, but still have a mRegistration set. > > void > > ContinueAfterInstallEvent(bool aInstallEventSuccess) > > { > > + nsresult rv = EnsureRegistration(); > > are we sure we don't have a mRegistration here? We probably do. This EnsureRegistration() call is verifying it has not changed on us. (For example, something didn't clear the registration and create a new one.)
Assignee | ||
Comment 22•9 years ago
|
||
I'll change the name of the method to EnsureAndVerifyRegistration() to clarify its doing more than setting mRegistration.
Assignee | ||
Comment 23•9 years ago
|
||
Attachment #8698281 -
Attachment is obsolete: true
Attachment #8700011 -
Flags: review+
Comment 24•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/b9b4e90792d2 https://hg.mozilla.org/integration/mozilla-inbound/rev/8589c8a2cfb5 https://hg.mozilla.org/integration/mozilla-inbound/rev/cc8bcaa0c789 https://hg.mozilla.org/integration/mozilla-inbound/rev/01f41e2e28fb https://hg.mozilla.org/integration/mozilla-inbound/rev/1b10997a06c6 https://hg.mozilla.org/integration/mozilla-inbound/rev/0a595c83b21f
Comment 25•9 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/b9b4e90792d2 https://hg.mozilla.org/mozilla-central/rev/8589c8a2cfb5 https://hg.mozilla.org/mozilla-central/rev/cc8bcaa0c789 https://hg.mozilla.org/mozilla-central/rev/01f41e2e28fb https://hg.mozilla.org/mozilla-central/rev/1b10997a06c6 https://hg.mozilla.org/mozilla-central/rev/0a595c83b21f
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox46:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla46
You need to log in
before you can comment on or make changes to this bug.
Description
•