ServiceWorkerManager singleton is cleared too late during shutdown

RESOLVED WONTFIX

Status

()

Core
DOM: Service Workers
RESOLVED WONTFIX
3 years ago
3 years ago

People

(Reporter: bkelly, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

3 years ago
Currently ServiceWorkerManager uses ClearOnShutdown() to drop its singleton reference.  This occurs around "XPCOM Component Shutdown" in this table:

  https://wiki.mozilla.org/XPCOM_Shutdown

Thats pretty late in the process.

The SWM, however, does a bunch of cleanup much earlier at "xpcom-shutdown".

It seems this leaves a window during shutdown where a reference to the SWM can still be found, but the SWM is not in a fully initialized state.

We should either clear the SWM singleton ref at xpcom-shutdown time or check mShuttingDown in GetInstance.
(Reporter)

Comment 1

3 years ago
I guess keeping the ref might be necessary for clearing events through shutdown.  Maybe the mShuttingDown variable is the way to handle this.

I'm going to leave this bug open for now, but not actively work on a patch.
Assignee: bkelly → nobody
Status: ASSIGNED → NEW
(Reporter)

Comment 2

3 years ago
Yea, mShuttingDown is the way to go.  Sorry for the noise here.
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.