Closed Bug 2017230 Opened 3 months ago Closed 2 months ago

Add async shutdown blocker to CookiePersistentStorage

Categories

(Core :: Networking: Cookies, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
150 Branch
Tracking Status
firefox150 --- fixed

People

(Reporter: jstutte, Assigned: jstutte)

References

(Blocks 1 open bug)

Details

(Whiteboard: [necko-triaged])

Attachments

(1 file)

If we hang when the DB is closed we currently lump this into bug 1679425. CookiePersistentStorage should have its own shutdown handling.

CookiePersistentStorage had no async shutdown blocker. During shutdown,
Close() synchronously joined the Cookie thread and then fired AsyncClose,
but nothing held the shutdown barrier while sqlite3_close completed on
the async thread. This caused the main thread to block in
Connection::shutdownAsyncThread waiting for slow WAL truncation I/O.

Add an nsIAsyncShutdownBlocker on profile-before-change that initiates
the close in BlockShutdown and is removed when HandleDBClosed fires
after AsyncClose completes. Remove the now-redundant profile-before-change
and profile-do-change observers from CookieService, as runtime profile
switching no longer exists. Add testCloseCookieDB/testOpenCookieDB IDL
methods to replace the tests' direct observe() calls for simulating
profile changes.

Note that this will not fix the shutdown hang as such, it will just make it
attributable to the CookieService more easily.

Assignee: nobody → jstutte
Attachment #9545636 - Attachment description: WIP: Bug 2017230 - Add async shutdown blocker to CookiePersistentStorage r?#cookie-reviewers → Bug 2017230 - Add async shutdown blocker to CookiePersistentStorage r?#cookie-reviewers
Status: NEW → ASSIGNED
Severity: -- → S4
Priority: -- → P2
Whiteboard: [necko-triaged]
Pushed by jstutte@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/ed27d9c3bfd5 https://hg.mozilla.org/integration/autoland/rev/4b4b92290b18 Add async shutdown blocker to CookiePersistentStorage r=cookie-reviewers,valentin
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 150 Branch
See Also: → 2019211
Regressions: 2019599
QA Whiteboard: [qa-triage-done-c151/b150]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: