Closed
Bug 1238990
Opened 9 years ago
Closed 9 years ago
service worker should not propagate updates across processes
Categories
(Core :: DOM: Service Workers, defect)
Tracking
()
RESOLVED
FIXED
mozilla46
Tracking | Status | |
---|---|---|
firefox46 | --- | fixed |
People
(Reporter: bkelly, Assigned: bkelly)
References
(Blocks 1 open bug)
Details
Attachments
(2 files, 2 obsolete files)
944 bytes,
patch
|
ehsan.akhgari
:
review+
|
Details | Diff | Splinter Review |
2.84 KB,
patch
|
bkelly
:
review+
|
Details | Diff | Splinter Review |
Currently when we trigger an update we "propagate" it through the parent process. This sends the update trigger to all child processes. This is bad for a number of reasons:
1) Multiple children can run the same update at the same time. For example, this could result in simultaneous, overlapping install events.
2) This can result in an actor in the parent process running content script. This is bad for security.
Instead we should remove the update propagation mechanism completely. Instead, the update should just run in the current process. This will work because:
a) All the updates trigger in the child, so all updates will run in a child.
b) Any service worker script changes will result in a StoreRegistration() call that is propagated to other processes.
There will still be the possibility for independent child processes to perform the same update, but they would both have to get individual triggers at the same time. This is much less likely (although still possible given our 24 hour gating, etc.)
In the long run our e10s refactor will fix this whole mess. I want to remove the current propagation mechanism now, though, because I think it creates a lot more race conditions and is generally incorrect at the moment.
Assignee | ||
Comment 1•9 years ago
|
||
Hmm, I guess we still need some way for about:serviceworkers to trigger an update.
Assignee | ||
Comment 2•9 years ago
|
||
Assignee | ||
Comment 3•9 years ago
|
||
I can't remove all the PropagateSoftUpdate() code, but we can assert that its only ever called from the parent process where the about:serviceworkers tab runs.
Assignee | ||
Comment 4•9 years ago
|
||
Triggering the updates locally by default actually causes us to hit the shutdown leak from bug 1232558. The P1 patch from that bug seems to fix the problem, though.
Here is a partial try to see if this solves the intermittent in bug 1232136:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=88adbb91662e
Assignee | ||
Comment 5•9 years ago
|
||
Comment on attachment 8707029 [details] [diff] [review]
P1 ServiceWorkerManager should trigger automatic updates in current process. r=ehsan
20+ green triggers on M-e10s(5). It seems to fix that intermittent. I'm hopeful this will fix many of our other e10s intermittents as well.
A wider try build:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=47cf9f4ba255
Attachment #8707029 -
Flags: review?(ehsan)
Assignee | ||
Updated•9 years ago
|
Attachment #8707030 -
Flags: review?(ehsan)
Assignee | ||
Updated•9 years ago
|
Attachment #8707032 -
Flags: review?(ehsan)
Assignee | ||
Comment 6•9 years ago
|
||
Comment on attachment 8707030 [details] [diff] [review]
P2 Release assert that updates are only propagated from the parent process. r=ehsan
It seems about:serviceworkers runs in the child, not the parent. Let me try something else here.
Attachment #8707030 -
Flags: review?(ehsan)
Updated•9 years ago
|
Attachment #8707029 -
Flags: review?(ehsan) → review+
Updated•9 years ago
|
Attachment #8707032 -
Flags: review?(ehsan) → review+
Assignee | ||
Comment 7•9 years ago
|
||
Attachment #8707030 -
Attachment is obsolete: true
Attachment #8707032 -
Attachment is obsolete: true
Attachment #8707138 -
Flags: review+
Assignee | ||
Comment 8•9 years ago
|
||
I'm going to split the work to fix up about:serviceworkers into a separate bug. It will still function as it previously did until then.
New try with just these two patches:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=96492ade8eb6
Comment 10•9 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/8f6fa255e10d
https://hg.mozilla.org/mozilla-central/rev/0a9ab8439294
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
•