Blocking preference write causes us to re-enter event loop

RESOLVED FIXED in Firefox 57

Status

()

RESOLVED FIXED
a year ago
a year ago

People

(Reporter: milan, Assigned: milan)

Tracking

(Blocks: 1 bug)

unspecified
mozilla57
All
Unspecified
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox56 unaffected, firefox57 fixed)

Details

Attachments

(1 attachment)

See 1386263.  The goal of the sync pref file save off the main thread was to block the main thread until the work is done, not to allow an event loop to spin which is allowed to process other events.
Assignee: nobody → milan
See Also: → bug 1386263, bug 789945
We are using nsIEventTarget::Dispatch with DISPATCH_SYNC flag.  We should have been using SyncRunnable::DispatchToThread instead.
Comment hidden (mozreview-request)

Comment 4

a year ago
mozreview-review
Comment on attachment 8895073 [details]
Bug 1388464: Use SyncRunnable instead of DISPATCH_SYNC to actually block the main thread during the blocking preference file write.

https://reviewboard.mozilla.org/r/166198/#review171466
Attachment #8895073 - Flags: review?(bugs) → review+
NI Benjamin just to make sure he's seen this.
Flags: needinfo?(benjamin)

Comment 7

a year ago
Pushed by msreckovic@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/6ffe8a4a92c7
Use SyncRunnable instead of DISPATCH_SYNC to actually block the main thread during the blocking preference file write.  r=smaug

Comment 8

a year ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/6ffe8a4a92c7
Status: NEW → RESOLVED
Last Resolved: a year ago
status-firefox57: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla57

Updated

a year ago
Flags: needinfo?(benjamin)

Comment 9

a year ago
Didn't this code land for 56? I think this needs an uplift.
status-firefox56: --- → ?
tracking-firefox56: --- → ?
Flags: needinfo?(milan)
Indeed, but 56 has it disabled through a preference, so we shouldn't hit this codepath.  But, yes, if we want to enable the off main thread preference write and on pref change auto save, we'd need this patch as well.
Flags: needinfo?(milan)
Track 56+ in case we will enable the pref.
tracking-firefox56: ? → +
This is still disabled by pref in 56, so 56 is unaffected.
status-firefox56: ? → unaffected
tracking-firefox56: + → ---
Duplicate of this bug: 1387242
You need to log in before you can comment on or make changes to this bug.