Bug 1588152 Comment 5 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

I hit this or a similar issue in https://bugzilla.mozilla.org/show_bug.cgi?id=1474608#c17. I got "AsyncShutdown timeout in profile-change-teardown Conditions: [{"name":"ServiceWorkerShutdownBlocker: shutting down Service Workers","state":{"pendingPromises":0,"acceptingPromises":true},"filename":"/builds/worker/workspace/build/src/dom/serviceworkers/ServiceWorkerShutdownBlocker.cpp","lineNumber":82,"stack":"Service Workers shutdown"}] At least one completion condition failed to complete within a reasonable amount of"

I'm not sure if it can occur in general Firefox users because [SWM would be initialized by Document](https://searchfox.org/mozilla-central/rev/ea63a0888d406fae720cf24f4727d87569a8cab5/dom/base/Document.cpp#7103), but my case is:

[Some services (e.g. clear data) would initialize SWM through the lazy getter](https://searchfox.org/mozilla-central/rev/ea63a0888d406fae720cf24f4727d87569a8cab5/toolkit/components/cleardata/ClearDataService.jsm#409). It becomes an issue if the SWM is initialized during the "profile-change-teardown" stage because the [shutdown block can only be removed after stopping accepting the promise](https://searchfox.org/mozilla-central/rev/ea63a0888d406fae720cf24f4727d87569a8cab5/dom/serviceworkers/ServiceWorkerShutdownBlocker.cpp#132-134), then it won't have a chance to [stop accepting promise](https://searchfox.org/mozilla-central/rev/ea63a0888d406fae720cf24f4727d87569a8cab5/dom/serviceworkers/ServiceWorkerShutdownBlocker.cpp#111) and thus remove the blocker. Consequently, it introduces the shutdown hang.
I hit this or a similar issue in https://bugzilla.mozilla.org/show_bug.cgi?id=1474608#c17.

The message I got is:
"AsyncShutdown timeout in profile-change-teardown Conditions: [{"name":"ServiceWorkerShutdownBlocker: shutting down Service Workers","state":{"pendingPromises":0,"acceptingPromises":true},"filename":"/builds/worker/workspace/build/src/dom/serviceworkers/ServiceWorkerShutdownBlocker.cpp","lineNumber":82,"stack":"Service Workers shutdown"}] At least one completion condition failed to complete within a reasonable amount of"

I'm not sure if it can occur in general Firefox users because [SWM would be initialized by Document](https://searchfox.org/mozilla-central/rev/ea63a0888d406fae720cf24f4727d87569a8cab5/dom/base/Document.cpp#7103), but my case is:

[Some services (e.g. clear data) would initialize SWM through the lazy getter](https://searchfox.org/mozilla-central/rev/ea63a0888d406fae720cf24f4727d87569a8cab5/toolkit/components/cleardata/ClearDataService.jsm#409). It becomes an issue if the SWM is initialized during the "profile-change-teardown" stage because the [shutdown block can only be removed after stopping accepting the promise](https://searchfox.org/mozilla-central/rev/ea63a0888d406fae720cf24f4727d87569a8cab5/dom/serviceworkers/ServiceWorkerShutdownBlocker.cpp#132-134), then it won't have a chance to [stop accepting promise](https://searchfox.org/mozilla-central/rev/ea63a0888d406fae720cf24f4727d87569a8cab5/dom/serviceworkers/ServiceWorkerShutdownBlocker.cpp#111) and thus remove the blocker. Consequently, it introduces the shutdown hang.
I hit this or a similar issue in https://bugzilla.mozilla.org/show_bug.cgi?id=1474608#c17.

The message I got is:
"AsyncShutdown timeout in profile-change-teardown Conditions: [{"name":"ServiceWorkerShutdownBlocker: shutting down Service Workers","state":{"pendingPromises":0,"acceptingPromises":true},"filename":"/builds/worker/workspace/build/src/dom/serviceworkers/ServiceWorkerShutdownBlocker.cpp","lineNumber":82,"stack":"Service Workers shutdown"}] At least one completion condition failed to complete within a reasonable amount of"

I'm not sure if it can occur in general Firefox users because [SWM is usually initialized while loading Documents](https://searchfox.org/mozilla-central/rev/ea63a0888d406fae720cf24f4727d87569a8cab5/dom/base/Document.cpp#7103), but my case is:

[Some services (e.g. clear data) would initialize SWM through the lazy getter](https://searchfox.org/mozilla-central/rev/ea63a0888d406fae720cf24f4727d87569a8cab5/toolkit/components/cleardata/ClearDataService.jsm#409). It becomes an issue if the SWM is initialized during the "profile-change-teardown" stage because the [shutdown block can only be removed after stopping accepting the promise](https://searchfox.org/mozilla-central/rev/ea63a0888d406fae720cf24f4727d87569a8cab5/dom/serviceworkers/ServiceWorkerShutdownBlocker.cpp#132-134), then it won't have a chance to [stop accepting promise](https://searchfox.org/mozilla-central/rev/ea63a0888d406fae720cf24f4727d87569a8cab5/dom/serviceworkers/ServiceWorkerShutdownBlocker.cpp#111) and thus remove the blocker. Consequently, it introduces the shutdown hang.
I hit this or a similar issue in https://bugzilla.mozilla.org/show_bug.cgi?id=1474608#c17.

The message I got is:
"AsyncShutdown timeout in profile-change-teardown Conditions: [{"name":"ServiceWorkerShutdownBlocker: shutting down Service Workers","state":{"pendingPromises":0,"acceptingPromises":true},"filename":"/builds/worker/workspace/build/src/dom/serviceworkers/ServiceWorkerShutdownBlocker.cpp","lineNumber":82,"stack":"Service Workers shutdown"}] At least one completion condition failed to complete within a reasonable amount of"

I'm not sure if mine case can acutal occur in general Firefox users because [SWM is usually initialized while loading documents](https://searchfox.org/mozilla-central/rev/ea63a0888d406fae720cf24f4727d87569a8cab5/dom/base/Document.cpp#7103), but my case is:

[Some services (e.g. clear data) would initialize SWM through the lazy getter](https://searchfox.org/mozilla-central/rev/ea63a0888d406fae720cf24f4727d87569a8cab5/toolkit/components/cleardata/ClearDataService.jsm#409). It becomes an issue if the SWM is initialized during the "profile-change-teardown" stage because the [shutdown block can only be removed after stopping accepting the promise](https://searchfox.org/mozilla-central/rev/ea63a0888d406fae720cf24f4727d87569a8cab5/dom/serviceworkers/ServiceWorkerShutdownBlocker.cpp#132-134), then it won't have a chance to [stop accepting promise](https://searchfox.org/mozilla-central/rev/ea63a0888d406fae720cf24f4727d87569a8cab5/dom/serviceworkers/ServiceWorkerShutdownBlocker.cpp#111) and thus remove the blocker. Consequently, it introduces the shutdown hang.

Back to Bug 1588152 Comment 5