Closed Bug 1912893 Opened 2 months ago Closed 2 months ago

Extracting the attachments bundle leads to shutdown crash

Categories

(Firefox :: Remote Settings Client, defect)

defect

Tracking

()

RESOLVED FIXED
131 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr128 --- unaffected
firefox129 --- unaffected
firefox130 + fixed
firefox131 --- fixed

People

(Reporter: leplatrem, Assigned: acottner)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression)

Crash Data

Attachments

(1 file)

The security-state/intermediates collection leads to a lot of crashes on Beta after we landed Bug 1889617

crash stats

It seems that the code is faulty, and that a promise is not awaited during the bundle extraction, which leads to massive number of parallel write on IndexedDB, and crashing in some context (eg. shutdown).

Assignee: nobody → acottner
Status: NEW → ASSIGNED
Attachment #9418936 - Attachment description: WIP: Bug 1912893. Adding await to cacheAll attachment save to prevent too many IO requests from being opened at once. → Bug 1912893. Adding await to cacheAll attachment save to prevent too many IO requests from being opened at once.

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

Attachment #9418936 - Attachment description: Bug 1912893. Adding await to cacheAll attachment save to prevent too many IO requests from being opened at once. → Fix attachments bundle extraction to prevent shutdown crash in IndexedDB

Comment on attachment 9418936 [details]
Fix attachments bundle extraction to prevent shutdown crash in IndexedDB

Beta/Release Uplift Approval Request

  • User impact if declined: A lot of users (~2%) seem to report crash during shutdown without this patch.
  • Is this code covered by automated tests?: No
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): The previous code was initiating promising in a loop, this patch adds a await, which will run the operations of the loop sequentially. The change is trivial.
  • String changes made/needed:
  • Is Android affected?: Yes
Attachment #9418936 - Flags: approval-mozilla-beta?
Pushed by mleplatre@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/6fe6944f58a8 Fix attachments bundle extraction to prevent shutdown crash in IndexedDB r=leplatrem
Crash Signature: [@ AsyncShutdownTimeout | profile-before-change | RemoteSettingsClient - finish IDB access.]
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 131 Branch
Blocks: 1913068

Comment on attachment 9418936 [details]
Fix attachments bundle extraction to prevent shutdown crash in IndexedDB

Approved for 130 beta 5, thanks.

Attachment #9418936 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
See Also: → 1913142

Just to close the loop, from the patch, Nick Alexander asked:

Can we add a test for this, to ensure the queue doesn't grow without bound? (Possibly as follow-up.)

Would bug 1913068 cover this or is there a separate bug (filed or yet to be filed) that would cover this? Could we assert in debug builds or something?

Flags: needinfo?(mathieu)
Flags: needinfo?(acottner)

Would bug 1913068 cover this

Not really, this one was more about have an end-to-end test from bundle extraction to indexeddb.

or is there a separate bug (filed or yet to be filed) that would cover this?

I am not sure about this, and/or how to implement such tests.

Could we assert in debug builds or something?

Why not, but what would be a reasonable limit?

We'll definitely want to save attachments in bulk, and opened https://bugzilla.mozilla.org/show_bug.cgi?id=1913142 for this.

If you have a precise idea in mind on how we should do this follow-up, could you please guide us? We would be happy to do the work

Flags: needinfo?(mathieu)
Flags: needinfo?(acottner) → needinfo?(gijskruitbosch+bugs)

(In reply to Mathieu Leplatre [:leplatrem] from comment #9)

Would bug 1913068 cover this

Not really, this one was more about have an end-to-end test from bundle extraction to indexeddb.

or is there a separate bug (filed or yet to be filed) that would cover this?

I am not sure about this, and/or how to implement such tests.

Could we assert in debug builds or something?

Why not, but what would be a reasonable limit?

We'll definitely want to save attachments in bulk, and opened https://bugzilla.mozilla.org/show_bug.cgi?id=1913142 for this.

If you have a precise idea in mind on how we should do this follow-up, could you please guide us? We would be happy to do the work

I imagine a marionette test could check that downloading and saving the bundles is aborted/completed in a sensible fashion if the browser is shutdown in the interim? Or you could simulate the same in an xpcshell test (which may be easier). I'm not sure if Nick had other ideas. I'd needinfo him but those are blocked while he's on PTO...

Flags: needinfo?(gijskruitbosch+bugs)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: