Open
Bug 1844486
Opened 1 year ago
Updated 1 year ago
BackgroundWorker build and shutdown should gracefully handle early interruption
Categories
(WebExtensions :: General, defect, P3)
WebExtensions
General
Tracking
(Not tracked)
NEW
People
(Reporter: robwu, Unassigned)
References
(Blocks 1 open bug)
Details
(Whiteboard: [addons-jira])
The current build/shutdown logic of the background service worker seems to rely on the assumption that shutdown
is only called once build
has finished. The code doesn't account for early interruptions, which can potentially cause the BackgroundWorker
's logic to be stuck waiting for a notification that never arrives:
build
waiting for context, potentially forever: https://searchfox.org/mozilla-central/rev/4537bb2abc8eb49506bbad27b89ab364ac3062d3/toolkit/components/extensions/parent/ext-backgroundPage.js#180-184,187build
with multipleawait
+shutdown
that can't interrupt early: https://searchfox.org/mozilla-central/rev/4537bb2abc8eb49506bbad27b89ab364ac3062d3/toolkit/components/extensions/parent/ext-backgroundPage.js#194,198-201 .
For comparison, the BackgroundPage implementation does guarantee that shutdown()
can be called at any point, and that the result is eventually cleaned up. This is relies upon to support atomic backgroundState transitions in bug 1762225.
Updated•1 year ago
|
Severity: -- → S4
Priority: -- → P3
Whiteboard: [addons-jira]
Updated•1 year ago
|
You need to log in
before you can comment on or make changes to this bug.
Description
•