A pending asyncStorage.setItem() request leaks the toolbox window until shutdown
Categories
(DevTools :: General, defect)
Tracking
(Not tracked)
People
(Reporter: florian, Assigned: florian)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
TEST-FAIL | Shutdown - leaked window until shutdown [url = about:devtools-toolbox], in two jobs on different debugger tests. The process's own leakcheck passed both times.
asyncStorage.setItem()'s onerror handler closes over the value being stored, and the debugger calls setItem() fire-and-forget through async-store-helper.js. A request still outstanding when the toolbox is torn down keeps that value alive, and through it the per-window browser loader sandbox it was created in and that sandbox's console, which is the debugger window. The handler never fired; the request was simply still pending.
Only --restart-between-tests jobs have been seen to hit it, where the IndexedDB database is created cold and a write is still in flight at teardown. Moving the error handler out of the scope that holds the value fixes it.
| Assignee | ||
Comment 1•3 days ago
|
||
The debugger writes pending breakpoints, blackboxed ranges and opened URLs
through asyncStorage.setItem() without awaiting the result, so a write can still
be in flight when the toolbox is destroyed. The value the pending request
retains reaches the debugger window through the browser loader sandbox it was
created in and that sandbox's window.console. That is the "leaked 1 window(s)
until shutdown [url = about:devtools-toolbox]" failure on
browser_dbg-editor-gutter.js and browser_dbg-expressions.js.
Updated•3 days ago
|
Description
•