Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

[Bug] Main thread network call on start up: HomeMenu calls getExperimentBranch #16901

Closed
mcomella opened this issue Dec 7, 2020 · 2 comments
Closed
Labels
🐞 bug Crashes, Something isn't working, .. needs:triage Issue needs triage performance Possible performance wins S1 Blocks development/testing, may impact more than 25% of users, causes data loss, potential chemspill

Comments

@mcomella
Copy link
Contributor

mcomella commented Dec 7, 2020

Steps to reproduce

  • Install debug app
  • Start app

Expected behavior

No crash

Actual behavior

Crash

12-07 13:23:27.416 E/AndroidRuntime(29476): Caused by: android.os.strictmode.DiskReadViolation
12-07 13:23:27.416 E/AndroidRuntime(29476): at android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1596)
12-07 13:23:27.416 E/AndroidRuntime(29476): at java.io.UnixFileSystem.getLastModifiedTime(UnixFileSystem.java:289)
12-07 13:23:27.416 E/AndroidRuntime(29476): at java.io.File.lastModified(File.java:939)
12-07 13:23:27.416 E/AndroidRuntime(29476): at java.util.zip.ZipFile.(ZipFile.java:265)
12-07 13:23:27.416 E/AndroidRuntime(29476): at java.util.zip.ZipFile.(ZipFile.java:187)
12-07 13:23:27.416 E/AndroidRuntime(29476): at java.util.jar.JarFile.(JarFile.java:169)
12-07 13:23:27.416 E/AndroidRuntime(29476): at java.util.jar.JarFile.(JarFile.java:106)
12-07 13:23:27.416 E/AndroidRuntime(29476): at libcore.io.ClassPathURLStreamHandler.(ClassPathURLStreamHandler.java:46)
...
12-07 13:23:27.416 E/AndroidRuntime(29476): at mozilla.components.concept.fetch.Response$Body.(Response.kt:66)
12-07 13:23:27.416 E/AndroidRuntime(29476): at mozilla.components.browser.engine.gecko.fetch.GeckoViewFetchClientKt.toResponse(GeckoViewFetchClient.kt:118)
12-07 13:23:27.416 E/AndroidRuntime(29476): at mozilla.components.browser.engine.gecko.fetch.GeckoViewFetchClient.fetch(GeckoViewFetchClient.kt:65)
12-07 13:23:27.416 E/AndroidRuntime(29476): at mozilla.appservices.httpconfig.RustHttpConfig.doFetch$httpconfig_release(HttpConfig.kt:81)
12-07 13:23:27.416 E/AndroidRuntime(29476): at mozilla.appservices.httpconfig.CallbackImpl.invoke(HttpConfig.kt:135)
12-07 13:23:27.416 E/AndroidRuntime(29476): at java.lang.reflect.Method.invoke(Native Method)
12-07 13:23:27.416 E/AndroidRuntime(29476): at com.sun.jna.CallbackReference$DefaultCallbackProxy.invokeCallback(CallbackReference.java:520)
12-07 13:23:27.416 E/AndroidRuntime(29476): at com.sun.jna.CallbackReference$DefaultCallbackProxy.callback(CallbackReference.java:551)
12-07 13:23:27.416 E/AndroidRuntime(29476): at com.sun.jna.Native.invokeStructure(Native Method)
12-07 13:23:27.416 E/AndroidRuntime(29476): at com.sun.jna.Native.invokeStructure(Native.java:2102)
12-07 13:23:27.416 E/AndroidRuntime(29476): at com.sun.jna.Function.invoke(Function.java:445)
12-07 13:23:27.416 E/AndroidRuntime(29476): at com.sun.jna.Function.invoke(Function.java:361)
12-07 13:23:27.416 E/AndroidRuntime(29476): at com.sun.jna.Library$Handler.invoke(Library.java:265)
12-07 13:23:27.416 E/AndroidRuntime(29476): at java.lang.reflect.Proxy.invoke(Proxy.java:1006)
12-07 13:23:27.416 E/AndroidRuntime(29476): at $Proxy8.nimbus_1725_NimbusClient_get_experiment_branch(Unknown Source)
12-07 13:23:27.416 E/AndroidRuntime(29476): at org.mozilla.experiments.nimbus.NimbusClient.getExperimentBranch(nimbus.kt:879)
12-07 13:23:27.416 E/AndroidRuntime(29476): at mozilla.components.service.nimbus.Nimbus.getExperimentBranch(Nimbus.kt:171)
12-07 13:23:27.416 E/AndroidRuntime(29476): at org.mozilla.fenix.home.HomeMenu$coreMenuItems$2.invoke(HomeMenu.kt:102)
12-07 13:23:27.416 E/AndroidRuntime(29476): at org.mozilla.fenix.home.HomeMenu$coreMenuItems$2.invoke(HomeMenu.kt:32)
12-07 13:23:27.416 E/AndroidRuntime(29476): at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
12-07 13:23:27.416 E/AndroidRuntime(29476): at org.mozilla.fenix.home.HomeMenu.getCoreMenuItems(Unknown Source:2)
12-07 13:23:27.416 E/AndroidRuntime(29476): at org.mozilla.fenix.home.HomeMenu.(HomeMenu.kt:218)

It seems to indicate it's a disk read violation but it also appears this would do main thread IO because it's accessing GeckoViewFetchClient.

It's very important that we don't do main thread network calls because they can cause users to wait for arbitrary amounts of time. Please find a solution that isn't suppression.

Note: we also crash in Nightly for a related but different reason: because we're unable to reach the server. I filed #16902 for that.

Device information

  • Android device: P2
  • Fenix version: master 948db6f

┆Issue is synchronized with this Jira Task

@mcomella mcomella added the 🐞 bug Crashes, Something isn't working, .. label Dec 7, 2020
@mcomella mcomella added this to Needs prioritization in Performance, front-end roadmap via automation Dec 7, 2020
@github-actions github-actions bot added the needs:triage Issue needs triage label Dec 7, 2020
@mcomella mcomella added the performance Possible performance wins label Dec 7, 2020
@mcomella mcomella added the S1 Blocks development/testing, may impact more than 25% of users, causes data loss, potential chemspill label Dec 7, 2020
@mcomella
Copy link
Contributor Author

mcomella commented Dec 7, 2020

S1: afaict, all (only new? not sure) users will make a main thread network call, causing delays to start up.

@csadilek
Copy link
Contributor

csadilek commented Dec 8, 2020

Duping this to #16852 which is also has the perf. label.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐞 bug Crashes, Something isn't working, .. needs:triage Issue needs triage performance Possible performance wins S1 Blocks development/testing, may impact more than 25% of users, causes data loss, potential chemspill
Projects
None yet
Development

No branches or pull requests

2 participants