Merge #4674
4674: 1586881: Fix high error rate on glean.baseline.duration r=mdboom a=mdboom
There is a race condition in how the TimingManager is used here.
When stopping a timer, we dispatch a task to actually record the value in the
timespan, and only reset the TimingManager in that async task after the
recording, which requires I/O, is complete.
If the timespan is started in the meantime, an error will be recorded, rather
than safely starting a new timespan measurement.
This change could be considered on the principle (followed elsewhere), that
we do timing management and measurement synchronously, and only recording
asynchronously.
Co-authored-by:
Michael Droettboom <mdboom@gmail.com>
Please register or sign in to comment