Closed Bug 1690052 Opened 4 years ago Closed 4 years ago

Potential race condition between Normandy timer and Normandy initialization

Categories

(Firefox :: Normandy Client, defect, P1)

defect

Tracking

()

RESOLVED FIXED
87 Branch
Tracking Status
firefox87 --- fixed

People

(Reporter: mythmon, Assigned: mythmon)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

We have been having problems that seem like recipes are running before Normandy proper has initialized. Specifically, during Normandy initialization, the values of default prefs are updated to match their rollout and experiment values. We are getting unenrollments from recipes that seem to imply this happens, and it happens more on computers with fewer CPU cores and slower drives.

The Normandy RecipeRunner runs in response to 3 things:

  1. When it is first initialized in some cases, which is strictly after Normandy initializes
  2. After RemoteSettings syncs (delayed up to 60 minutes), which is not strictly ordered to be after Normandy initialization
  3. When Firefox's update timer procs and calls the recipe runner.

Third third is the one that I expect is getting us most often, since the first is only called synchronously after prefs are applied, and it should be too uncommon for the random delay on the second to be fast enough to cause this problem in the volume we see.

I expect this will fix bug 1663971, but I'm making a separate bug since we aren't sure of the cause of that bug yet, and this may not fix it.

Assignee: nobody → mcooper
Status: NEW → ASSIGNED

This avoids a potential race condition where the RecipeRunner is triggered before Normandy has fully initialized. When this happens, recipes can wrongly unenroll or graduate, causing many problems and confusing telemetry.

The 30 second delay and 3x max retries were chosen arbitrarily.

Pushed by mcooper@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b8b16b23dad8 Wait until Normandy has updated default branch prefs before processing recipes r=Gijs
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 87 Branch
Blocks: 1690684
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: