Closed Bug 1716530 Opened 4 years ago Closed 4 years ago

ServiceWorkerManager must check for ongoing shutdown to avoid its resurrection

Categories

(Core :: DOM: Service Workers, defect, P3)

defect

Tracking

()

RESOLVED DUPLICATE of bug 1726813

People

(Reporter: jstutte, Unassigned)

References

Details

The ServiveWorkerManager singleton's static functions can be called even during late shutdown. But once we have shut it down and cleared its global, we should not accept any further invocation but throw an error.

See bug 1709184 comment 2 and following for more context.

Blocks: 1709184
See Also: → 1716533
Severity: -- → S3
Priority: -- → P3
Depends on: 1726813

ServiceWorkerManager::GetInstance has been hardened already in bug 1726813. AFAICS all uses of ServiceWorkerManager start with ServiceWorkerManager::GetInstance and the returned pointer is never set aside into some long-living variable or object.

So I think there should be nothing left to do if not look out for unhandled exceptions if we return nullptr.

If we want to be 110% sure against shutdown races we should check each public entrypoint of ServiceWorkerManager for long running operations that might overlap with the beginning of the shutdown. asuth, do you expect this to be a potential problem?

Flags: needinfo?(bugmail)

Yes, we can probably resolve this bug. And in our pair analysis, we noticed that maybe we need a bug covering handling calls to ServiceWorkerManager::GetInstance() in the content process and asserting hard in that case, noting that there may be some leftover calls from things like devtools. I think this was notionally a work item for cleanup following the switch to parent-intercept only.

Flags: needinfo?(bugmail)
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → DUPLICATE
See Also: → 1731081
You need to log in before you can comment on or make changes to this bug.