Sqlite.executeTransaction keeps the transaction open indefinitely if func() doesn't resolve
Categories
(Core :: SQLite and Embedded Database Bindings, task, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox94 | --- | fixed |
People
(Reporter: mak, Assigned: mak)
References
Details
Attachments
(6 files, 1 obsolete file)
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
2.50 KB,
text/plain
|
chutten
:
data-review+
|
Details |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review |
There's no protection in executeTransaction() against a func() that never resolves, the transaction would just stay open for the whole session.
We could .race() with a timeout, the ideal outcome at that point would be a ROLLBACK (because the transaction didn't complete), the problem is that if the timeout is long that rollback may affect many other changes that happened in the same timeframe. On the other side a COMMIT may commit a partial transaction and that's not ideal for data coherency.
The rollback solution could be acceptable if the timeout is not too long, but we'd need to land a telemetry probe to measure how many times we cross it and keep an eye over it. We may also want to assign a label to each executeTransaction call and report to the console when some transaction is timed-out, for debug purposes (ideally we'd telemetry the timing out labels somehow).
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Comment 1•3 years ago
|
||
initiatedTransaction seems less confusing about the fact Sqlite.jsm initiated this
transaction, rather than something else (that may happen with wrapped connections).
Assignee | ||
Comment 2•3 years ago
|
||
Remove the dependency on Log.jsm and follow the most common path of providing
a simple boolean pref to increase logging. Warn and Error are logged to the
console by default, while Debug must be enabled.
Depends on D124184
Assignee | ||
Comment 3•3 years ago
|
||
Depends on D124185
Assignee | ||
Comment 4•3 years ago
|
||
If the passed-in async function never resolves the transaction could stay alive forever, this timeouts after
TRANSACTIONS_QUEUE_TIMEOUT_MS (5 minutes as of now) and roll backs the transaction.
A telemetry keyed scalar is added to track callers causing these timeouts and optimize them in the future.
Depends on D124186
Assignee | ||
Comment 5•3 years ago
|
||
Please forward if you're too busy for this.
Assignee | ||
Updated•3 years ago
|
Comment 6•3 years ago
|
||
Comment on attachment 9238900 [details]
data-review.txt
DATA COLLECTION REVIEW RESPONSE:
Is there or will there be documentation that describes the schema for the ultimate data set available publicly, complete and accurate?
Yes.
Is there a control mechanism that allows the user to turn the data collection on and off?
Yes. This collection is Telemetry so can be controlled through Firefox's Preferences.
If the request is for permanent data collection, is there someone who will monitor the data over time?
Yes, Marco Bonardo is responsible.
Using the category system of data types on the Mozilla wiki, what collection type of data do the requested measurements fall under?
Category 1, Technical.
Is the data collection request for default-on or default-off?
Default on for all channels.
Does the instrumentation include the addition of any new identifiers?
No.
Is the data collection covered by the existing Firefox privacy notice?
Yes.
Does the data collection use a third-party collection tool?
No.
Result: datareview+
Assignee | ||
Comment 7•3 years ago
|
||
Add a pref to manage Sqlite.jsm logging, default to reporting Errors.
Change some of the logging to more coherently report warnings, errors and debug info.
Reuse the same logger for all the objects, just change the prefix.
Depends on D124184
Updated•3 years ago
|
Comment 9•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/e35a78cb5399
https://hg.mozilla.org/mozilla-central/rev/4b46bd28680f
https://hg.mozilla.org/mozilla-central/rev/204be801f197
https://hg.mozilla.org/mozilla-central/rev/c7a7c20d73c0
Comment 10•3 years ago
|
||
Comment 11•3 years ago
|
||
Comment 12•3 years ago
|
||
bugherder |
Updated•4 months ago
|
Description
•