Race condition in Sync Migration / Preference:Get

RESOLVED FIXED in Firefox 14

Status

()

defect
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: gcp, Assigned: Margaret)

Tracking

({dataloss})

Trunk
Firefox 15
ARM
Android
Points:
---

Firefox Tracking Flags

(firefox14 fixed, firefox15 fixed, blocking-fennec1.0 beta+)

Details

Attachments

(1 attachment)

https://bugzilla.mozilla.org/show_bug.cgi?id=752907#c9

Profile Migrator should not unregister its Preferences event listener until it actually received the preferences it asked for. It will currently get confused if someone else requests preferences at the same time.

D/ProfileMigrator( 1410): Received event: Preferences:Data
W/ProfileMigrator( 1410): Could not recover setting for = ui.zooming.animation_frames
Assignee: nobody → gpascutto
Nominating for blocking because this can prevent profile migration from finishing successfully.
blocking-fennec1.0: --- → ?
Keywords: dataloss
Posted patch patchSplinter Review
Assignee: gpascutto → margaret.leibovic
Attachment #622221 - Flags: review?(gpascutto)
I tested this patch with the STR from bug 752907 comment 0, and it indeed fixes the sync migration problem.
Comment on attachment 622221 [details] [diff] [review]
patch

Review of attachment 622221 [details] [diff] [review]:
-----------------------------------------------------------------

Our Preferences:Get design won't hold up in the long run. If you would fire a request for only one of the preferences elsewhere, we'd still misfire and think this was a reply to our request. We'll have to keep this in mind for the longer term.

::: mobile/android/base/ProfileMigrator.java
@@ +456,5 @@
>                      JSONObject jPref = jsonPrefs.getJSONObject(i);
>                      final String prefName = jPref.getString("name");
> +
> +                    // Check to make sure we're working with preferences we requested.
> +                    if (!Arrays.asList(SYNC_SETTINGS_LIST).contains(prefName))

I think this is guaranteed to be in mSyncSettingsList already.
Attachment #622221 - Flags: review?(gpascutto) → review+
> Our Preferences:Get design won't hold up in the long run. If you would fire
> a request for only one of the preferences elsewhere, we'd still misfire and
> think this was a reply to our request. We'll have to keep this in mind for
> the longer term.

Yeah, I ran into this problem when adding prefs to GeckoLayerClient and PanZoomController. I've filed bug 753312 for it.
Comment on attachment 622221 [details] [diff] [review]
patch

[Approval Request Comment]
User impact if declined: Sync will not migrate successfully dependent on timing.
Attachment #622221 - Flags: approval-mozilla-aurora?
Attachment #622221 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
blocking-fennec1.0: ? → beta+
https://hg.mozilla.org/mozilla-central/rev/228971745c99
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.