Investigate invalidState errors in new GeckoView pure glean metrics
Categories
(Data Platform and Tools :: Monitoring & Alerting, defect)
Tracking
(firefox125 fixed)
| Tracking | Status | |
|---|---|---|
| firefox125 | --- | fixed |
People
(Reporter: perry.mcmanis, Assigned: perry.mcmanis)
References
Details
Attachments
(2 files, 2 obsolete files)
We recently migrated these metric from Geckoview Streaming to a pure Glean impl. We are now seeing errors on Fenix. Speculatively, we may not have seen them before because they were truncated inside of Legacy before being passed to Glean.
Investigate what's going on with these fields:
- Geckoview.page_load_time is spiking InvalidState errors since Feb. 22 (affecting 1.5% of the population)
- Geckoview.page_reload_time InvalidState errors also increasing, but to a lesser degree.
| Assignee | ||
Comment 1•2 years ago
•
|
||
It's possible this was always happening and error hand-off was ???? due to it being GVST
FWIW I have confirmed that we collected data in this metric before migration:
SELECT
m.client_info.client_id,
submission_timestamp,
ARRAY_LENGTH(metrics.timing_distribution.geckoview_page_load_time.values) as kv_pair_counts,
client_info.app_display_version
-- plt.*
FROM
org_mozilla_firefox.metrics AS m
-- cross join
-- unnest (metrics.timing_distribution.geckoview_page_load_time.values) as plt
WHERE
DATE(submission_timestamp) >= DATE_SUB(CURRENT_DATE(), INTERVAL 60 DAY)
and ARRAY_LENGTH(metrics.timing_distribution.geckoview_page_load_time.values) > 0
and mozfun.norm.extract_version(client_info.app_display_version, "major") < 124
and mozfun.norm.extract_version(client_info.app_display_version, "major") > 120
LIMIT 100
This error occurs when .finish() is called, when I look at the code it appears that start() should HAVE to get called for us to get to the Glean call site, so I need to investigate what might be going on.
Thoughts:
ID collision? start twice, but only one id, try to cancel twice? seems unlikely
starting glean failed?
start() {
if (this.isRunning()) {
this.cancel();
}
this._timerId = this._metric.start();
}
pretty straightforward, so maybe we're failing inside of .start() OR maybe this.isRunning() isn't always cleared correctly
| Assignee | ||
Comment 2•2 years ago
|
||
After some discussion, the possibility of having the same timerID on multiple instances of ProgressTracker may actually have more realistic than I initially thought.
It's not very likely that this is being caused by Glean itself. If we take a look at start() for a timingDistribution's timer in the code, we see that we are incrementing IDs atomically and we have good reason to believe this is quite reliable.
I'd like to test if my premise is possible (and maybe even morph into a fix for this) by keeping a set of timerIDs and inside of ProgressTracker.start() guarantee that whatever timerID is generated by the stopwatch pattern is unique, (eventually, if not then ask for a new one). I think if we can find some evidence this is happening, then the fix may follow the same pattern (question mark, happy to get input on how best to actually do this if we need to make it more permanent).
:owlish since you reviewed chutten's patch I have tagged you, please feel free to direct me to someone else though!
My specific questions:
- Does the premise multiple progress trackers : a single id seem reasonably possible?
- Is my proposed idea for finding/solving this reasonable?
| Assignee | ||
Comment 3•2 years ago
|
||
OK I believe I have found evidence that we are indeed attaching the same timerID to multiple instances of the gleanStopwatch/progressTracker which may mean that we are calling cancel/stopAndAccumulate multiple times on a single timerID, which would indeed lead to an invalidState error.
| Assignee | ||
Comment 4•2 years ago
|
||
| Assignee | ||
Comment 5•2 years ago
|
||
Update: reports of duplicated timerIDs via the interface were a bit premature.
It turns out that a far more likely culprit is that null is cast to 0 internally for stopAndAccumulate() and cancel() meaning that when you feed null to these methods, they try to end the metric for id 0 instead.
See the screenshot for an idea of how to invoke this behavior.
Updated•2 years ago
|
| Assignee | ||
Comment 6•2 years ago
|
||
Comment 8•2 years ago
|
||
| bugherder | ||
Updated•2 months ago
|
Description
•