See: https://github.com/mozilla-mobile/fenix/issues/2810
From a small investigation could be related to the Constraints for RequiredNetworkType for WorkManager in PingUploadWorker ?
@Dexterp37 @travis79 @mdboom PingUploadWorker sounds like Glean. :)
The stacktrace almost looks like it's a bug in workmanager.
Thanks for the heads up, I'm looking into it.
While this does appear to be related to WorkManager based on the stack trace, I didn't see anything there that looked like it was specifically caused by Glean. We do use WorkManager to upload pings and have a network Constraint applied, but so do other components.
@ekager, in order to help me get to the bottom of this faster, can you please elaborate on the small investigation you performed to help me understand why you think this is caused by Glean? Thanks!
Hi @travis79 sorry to alarm anyone! My brief investigation was just looking through the crash report and seeing that it mentioned 'connectivity' and PingUploadWorker was the only file that came up when I searched, but it looks like when I search NetworkType.Connected there are more classes that use these constraints.
@travis79 I was able to confirm that the crash is related to Glean.
In Fenix, the telemetry services are behind a build flag, only activated on production builds or when a console parameter is supplied.
I activated the flag and only allow the GleanMetricsService to run.
val metrics: MetricController by lazy {
MetricController.create(
listOf(
GleanMetricsService(context)
// LeanplumMetricsService(context as Application),
// AdjustMetricsService(context)
),
isTelemetryEnabled = { Settings.getInstance(context).isTelemetryEnabled }
)
}
Using a Nexus 5X API 21 emulator(Android 5.0, Google APIs x86_64), I always get the crash.
STR: video demo
When I disable the GleanMetricsService to run, the crash never happens.
val metrics: MetricController by lazy {
MetricController.create(
listOf(
// GleanMetricsService(context),
LeanplumMetricsService(context as Application),
AdjustMetricsService(context)
),
isTelemetryEnabled = { Settings.getInstance(context).isTelemetryEnabled }
)
}
The issue is only happening on Android 5.0, it's pretty likely that is a backward compatibility issue on the WorkManager library.
We are using version 2.0.0. There's a version 2.0.1 (and also 2.1.0-alpha01, 2.1.0-alpha02).
@Amejia481 Can you test if 2.0.1 fixes that (if not maybe one of the alphas? Although we should see if we actually want to use them).
This one looks similar and was fixed in 2.0.1:
https://issuetracker.google.com/issues/129226383
Awesome, I will take a look at it 馃憤
@Amejia481 please keep me updated on this in case I need to make any changes. What's funny is I don't see anything in your STR that would trigger Glean to trigger sending a ping, which is what we use WorkManager for. (On second thought, it could do it when you swipe down the shade to toggle airplane mode... that would call onPause())
The 2.0.1 version fixed the issue 馃帀