Bookmarks/history locked error at startup despite no external process holding places.sqlite — appears to be an internal ConcurrentConnection race in Database::EnsureConnection()
Categories
(Toolkit :: Places, defect, P2)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox155 | --- | fixed |
People
(Reporter: spwalsh8, Assigned: mak)
References
(Blocks 3 open bugs)
Details
(Whiteboard: [sng])
Attachments
(1 file, 1 obsolete file)
Steps to reproduce:
Upon fresh boot of Firefox running on Linux Mint 22.3, Firefox will occasionally display the error "The bookmarks and history system will not be functional because one of Firefox's files is in use by another application. Some security software can cause this problem."
I'm not sure what this error coincides with, as it does not happen every time. Approximately 1 out of every 10 boots.
Actual results:
The error doesn't allow me to use my bookmarks or see browsing history.
Expected results:
Here's what I've done to troubleshoot the problem.
-Updated to the most recent version of Firefox that Linux Mint will allow. It was installed by default.
-using ext4 filesystem; meaning not NTFS/dual boot/windows related problem
-No duplicate Firefox installs
-Correct permissions exist
-Timeshift (Linux Mint's backup program) explicitly excludes /home directory where Firefox is installed
-No antivirus/sync tool holding the file
-Evidence ruling out external causes: confirmed via lsof/fuser that only Firefox's own main process ever holds the file
Reference: point to toolkit/components/places/Database.cpp, function EnsureConnection(), and the ConcurrentConnection::MaybeInterrupt() retry logic — flag that this looks like the retry occasionally not being sufficient
Comment 1•2 months ago
|
||
The Bugbug bot thinks this bug should belong to the 'Firefox::Bookmarks & History' component, but is not confident enough to move the bug to that component.
| Reporter | ||
Comment 2•2 months ago
|
||
I've also tried following the advice in the link that accompanies the error. The advice is to delete the various sqlite files (e.g. favicons.sqlite, places.sqlite, favicons.sqlite-shm, favicons.sqlite-wal, places.sqlite-shm and places.sqlite-wal) and restart. While this does work, it is only temporary. The error appeared again a few boots later. Restarting Firefox works just as well as deleting these files.
| Assignee | ||
Comment 3•1 month ago
|
||
We have evidence the retry reduced the problem, but probably didn't solve it completely.
We should investigate the issue and see if we can make it more lenient (either wait longer or retry more often) before giving up.
Updated•1 month ago
|
| Assignee | ||
Comment 4•1 month ago
•
|
||
There's one complication, that is we can't easily make the main-thread "await" for other threads to release their lock. We'd have to sleep the main-thread, included the UI.
| Assignee | ||
Comment 5•1 month ago
|
||
We may have to force ConcurrentConnection to await for the main connection, and if it that doesn't go up before a certain amount of time (10-15s), forcibly start it. I would have liked to keep them more independent, but we can't do it until the main thread stops doing synchronous open.
| Assignee | ||
Updated•1 month ago
|
| Assignee | ||
Comment 6•1 month ago
|
||
In the parent process, ConcurrentConnection opening places.sqlite concurrently
with EnsureConnection() causes WAL-mode lock contention (SQLITE_LOCKED or
SQLITE_IOERR), which bypasses busy_timeout. Defer the CC open until
TOPIC_PLACES_INIT_COMPLETE, which fires only after the main connection is
established. A 10s fallback timer handles the case where the notification
never arrives.
| Assignee | ||
Comment 7•1 month ago
|
||
Content processes don't receive TOPIC_PLACES_INIT_COMPLETE, so
ConcurrentConnection has no signal to retry opening the database after an
initial failure. Forward the notification from the parent via PContent so the
existing Observe() handler can trigger the retry.
| Assignee | ||
Comment 8•1 month ago
|
||
Dropping the IPC changes from this bug and moving them to https://bugzilla.mozilla.org/show_bug.cgi?id=2059368 since they are unnecessary for the bug fix
Updated•1 month ago
|
Comment 10•1 month ago
|
||
| bugherder | ||
Comment 11•1 month ago
|
||
Comment 12•1 month ago
|
||
Backed out for causing gtest failures at ConcurrentConnection
Backout Link
Push with failures
Failure Log
Failure line [task 2026-08-04T22:27:25.304+00:00] 22:27:25 INFO - TEST-START | test_ConcurrentConnection.test_database_not_present
Updated•1 month ago
|
Comment 13•1 month ago
|
||
backout merged to main: https://hg.mozilla.org/mozilla-central/rev/b8154c219191
| Assignee | ||
Comment 14•1 month ago
•
|
||
It's failing (timing out on event loop spinning) only on linux-tsan
This is likely because it's super slow and it takes more than 10s to startup Places, and then the ConcurrentConnection timer fires and gives up.
Comment 15•1 month ago
|
||
Comment 16•1 month ago
|
||
| bugherder | ||
| Assignee | ||
Updated•1 month ago
|
Updated•25 days ago
|
Description
•