Closed Bug 1765628 Opened 2 years ago Closed 2 years ago

Launching multiple background task instances simultaneously causes races in temp profile cleanup

Categories

(Toolkit :: Application Update, defect, P1)

defect

Tracking

()

RESOLVED FIXED
102 Branch
Tracking Status
firefox-esr91 --- unaffected
firefox99 --- unaffected
firefox100 --- disabled
firefox101 --- disabled
firefox102 --- fixed

People

(Reporter: nalexander, Assigned: nalexander)

References

(Regression)

Details

(Keywords: regression, Whiteboard: [fidedi-ope])

Attachments

(3 files)

While investigating test failures re-enabling pingsender2, I discovered that launching many background task instances simultaneously causes races with the profile selection and the temp profile cleanup code.

I propose to salt the temporary profile directories with a pseudorandom value, so that it's very unlikely that two background task invocations will race to re-use the same temporary profile directory.

Salting in this manner will also make it a little harder to guess exactly where the temporary profile directory will be created, which is not crucial but may have some benefit as a defense-in-depth.

Severity: -- → S2
Priority: -- → P1

Set release status flags based on info from the regressing bug 1722777

Has Regression Range: --- → yes

This verifies that stale temporary profile purging does not interfere
with concurrent temporary profile creation and locking.

Whiteboard: [fidedi-ope]
Attachment #9274338 - Attachment description: Bug 1765628 - Pre: Account for endianness with PR_INT64_MAX and PR_INT64_MIN, also correct twos complement error for PR_INT64_MIN. r=nalexander → Bug 1765628 - Pre: Account for endianness with PR_INT64_MAX and PR_INT64_MIN, also correct two's complement error for PR_INT64_MIN. r=nalexander
Pushed by nrishel@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1002fb6d619e
Don't delete recently created temporary profiles to avoid race between background task cleanup and background task profile locking. r=nalexander
https://hg.mozilla.org/integration/autoland/rev/555b163d97e3
Test that launching many background tasks concurrently succeeds. r=nrishel
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 102 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: