Closed Bug 875971 Opened 11 years ago Closed 6 years ago

Main thread SQLite: PRAGMA cache_size = -2048

Categories

(Toolkit :: Storage, defect)

x86_64
Windows 8
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 885732

People

(Reporter: taras.mozilla, Unassigned)

References

(Depends on 1 open bug)

Details

(Whiteboard: [snappy:p1])

please don't execute sql queries synchronously.
This creeped up into top ~20 slow main thread sql usages according to telemetry.
FHR uses Sqlite.jsm which executes *everything* (except connection open and close because there are no off-main-thread APIs for that) off the main thread. There is no statement execution API in Sqlite.jsm that is supposed to execute on the main thread.

This is either misidentification of main thread I/O or Sqlite.jsm/Storage is misbehaving. Either way, not a FHR bug.

https://hg.mozilla.org/mozilla-central/file/7a2f7a45819a/services/metrics/storage.jsm#l1115
https://hg.mozilla.org/mozilla-central/file/7a2f7a45819a/toolkit/modules/Sqlite.jsm#l454
https://hg.mozilla.org/mozilla-central/file/7a2f7a45819a/toolkit/modules/Sqlite.jsm#l767

I'm on holiday. Someone else will have to dig into this.
Looks like it's due to main thread io in open() :(

http://dxr.mozilla.org/mozilla-central/storage/src/mozStorageConnection.cpp#l581

David/mak, when are we getting a proper async open?
Yeah, it's in open().
Async open is waiting for review (see bug 702559).
Component: Client: Desktop → Storage
Product: Firefox Health Report → Toolkit
fwiw, the only thing we can do here is convert consumers from sync to async, it's pretty clear we can't avoid main-thread queries for a synchronous consumer.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.