Closed Bug 1769152 Opened 2 years ago Closed 2 years ago

IOUtils must support writing until the end of profile-before-change-telemetry

Categories

(Toolkit Graveyard :: OS.File, enhancement, P1)

enhancement

Tracking

(firefox105 fixed)

RESOLVED FIXED
105 Branch
Tracking Status
firefox105 --- fixed

People

(Reporter: barret, Assigned: barret)

References

Details

Attachments

(3 files)

TelemetryController.jsm registers a shutdown blocker for profile-before-change-telemetry, which happens after profile-before-change, which is when IOUtils shuts down its event queue. IOUtils will need to support telemetry writing during this period.

One solution is to keep our current behaviour of flushing the event queue after our profile-before-change barrier completes and then add a second barrier for profileBeforeChangeTelemetry. This barrier will re-enable the event queue until the end of its phase, so that (ideally) only IO can be submitted from within callbacks registered to fire on IOUtils.profileBeforeChangeTelemetry.

This way it becomes clear that only telemetry should be writing during this period and if something outside telemetry it adding a callback on IOUtils.profileBeforeChangeTelemetry it will stick out.

Assignee: nobody → brennie
Blocks: 1772938
Blocks: 1772733
No longer blocks: 1772733
Blocks: 1779759
Priority: P2 → P1

Now we create barriers for all shutdown phases (xpcom-will-shutdown included)
and have them register the previous phase's completion as a blocker. This
allows for a simplified implementation of IOUtilsShutdownBlocker, especially in
the next patch where we add support for an additional shutdown phase.

In normal shutdown, the previous phase will already be completed by the time we
hit the blocker. However, in xpcshell tests, we are not going to hit the
profile-before-change etc. shutdown phases, so we still need to ensure that IO
finished, so we can recursively wait on previous phases to complete.

Depends on D152921

Pushed by brennie@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f35857d61717
Refactor IOUtils to use an EnumeratedArray for shutdown blockers r=nika
https://hg.mozilla.org/integration/autoland/rev/486eea40c98d
Make IOUtils Shutdown blockers depend on previous phase completion r=nika
https://hg.mozilla.org/integration/autoland/rev/c2840b590960
Add support for profile-before-change-telemetry in IOUtils r=nika

Backed out for causing build bustages on IOUtils.cpp

  • Backout link
  • Push with failures
  • Failure Log
  • Failure line: package> Assertion failure: aPhase >= IOUtils::ShutdownPhase::ProfileBeforeChange && aPhase < IOUtils::ShutdownPhase::XpcomWillShutdown, at /builds/worker/checkouts/gecko/dom/system/IOUtils.cpp:2016

And also this mochitest failures: https://treeherder.mozilla.org/logviewer?job_id=386454896&repo=autoland

Flags: needinfo?(brennie)
Pushed by brennie@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/297dcbc2bb0a
Refactor IOUtils to use an EnumeratedArray for shutdown blockers r=nika
https://hg.mozilla.org/integration/autoland/rev/95f5ca920916
Make IOUtils Shutdown blockers depend on previous phase completion r=nika
https://hg.mozilla.org/integration/autoland/rev/9ab377e88dc8
Add support for profile-before-change-telemetry in IOUtils r=nika
Pushed by brennie@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ecced395ea6b
Refactor IOUtils to use an EnumeratedArray for shutdown blockers r=nika
https://hg.mozilla.org/integration/autoland/rev/53c04446c380
Make IOUtils Shutdown blockers depend on previous phase completion r=nika
https://hg.mozilla.org/integration/autoland/rev/81b4e1ce2626
Add support for profile-before-change-telemetry in IOUtils r=nika
Flags: needinfo?(brennie)
Pushed by brennie@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7aa2b6e0a451
Refactor IOUtils to use an EnumeratedArray for shutdown blockers r=nika
https://hg.mozilla.org/integration/autoland/rev/7eb0086ba15b
Make IOUtils Shutdown blockers depend on previous phase completion r=nika
https://hg.mozilla.org/integration/autoland/rev/7a3a1200b2c6
Add support for profile-before-change-telemetry in IOUtils r=nika
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 105 Branch
Product: Toolkit → Toolkit Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: