question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ANR for Firebase Performance

See original GitHub issue

[READ] Step 1: Are you in the right place?

I do. reporting an ANR coming from RemoteConfigComponent (as far as I can say)

[REQUIRED] Step 2: Describe your environment

Firebase BoM 25.6.0 (Firebase Perf 19.0.8 if I’m not mistaken)

[REQUIRED] Step 3: Describe the problem

We are experiencing thousands ANRs at FirebasePerformance creation step. Looking at the source code, I believe the thread blocks trying to get/create an instance from RemoteConfigComponent.get("fireperf"). that method is access from main thread, is synchronized and internally it executes a few disk accesses.

Here is a stacktrace of the main thread and another one, both blocked.

Main thread:

at com.google.firebase.perf.zza.create (zza.java:2)
  at com.google.firebase.components.ComponentRuntime.lambda$new$0 (ComponentRuntime.java:69)
  at com.google.firebase.components.ComponentRuntime$$Lambda$1.get (ComponentRuntime.java)
  at com.google.firebase.components.Lazy.get (Lazy.java:53)
  at com.google.firebase.components.ComponentRuntime.initializeEagerComponents (ComponentRuntime.java:158)
  at com.google.firebase.FirebaseApp.initializeAllApis (FirebaseApp.java:563)
  at com.google.firebase.FirebaseApp.initializeApp (FirebaseApp.java:304)
  at com.google.firebase.FirebaseApp.initializeApp (FirebaseApp.java:268)
  at com.careem.superapp.core.analytics.impl.firebase.FirebaseInitializer.initialize (FirebaseInitializer.java:33)
  at com.careem.superapp.initialization.BaseSuperApp.onCreate (BaseSuperApp.java:58)
  at com.careem.superapp.SuperApp.onCreate (SuperApp.java:44)
  at android.app.Instrumentation.callApplicationOnCreate (Instrumentation.java:1155)
  at android.app.ActivityThread.handleBindApplication (ActivityThread.java:6315)
  at android.app.ActivityThread.access$1300 (ActivityThread.java:220)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1815)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loop (Looper.java:226)
  at android.app.ActivityThread.main (ActivityThread.java:7224)
  at java.lang.reflect.Method.invoke (Method.java)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:500)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:913)

Other thread:

at com.google.firebase.components.Lazy.get (SourceFile:3)
  at g.k.c.d.a.get (SourceFile:2)
  at com.google.firebase.components.ComponentRuntime.get (SourceFile:1)
  at com.google.firebase.FirebaseApp.get (SourceFile:2)
  at com.google.firebase.perf.FirebasePerformance.getInstance (SourceFile:5)
  at com.google.firebase.perf.internal.zzd.zzbt (SourceFile:2)
  at com.google.firebase.perf.internal.zzd.zzc (SourceFile:2)
  at g.k.c.k.a.b.run (SourceFile:1)
  at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1167)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641)
  at java.lang.Thread.run (Thread.java:764)

Steps to reproduce:

Sorry, can’t repro locally. but the above stack trace should give an indication. I don’t think is relevant, but also wanted to add we disabled the FirebaseInitProvider and we init manually

Relevant Code:

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (13 by maintainers)

github_iconTop GitHub Comments

2reactions
ramanpreetSinghKhindacommented, Sep 15, 2020

@carlonzo

The fix will go in the upcoming release. You can keep an eye on the release notes for Firebase Performance.

Please reopen if the issue still persists with the latest perf sdk version.

0reactions
ramanpreetSinghKhindacommented, Sep 16, 2020

Thanks for checking in @carlonzo

Not currently unfortunately 😐

But once firebase-perf SDK gets open sourced you should be able to see the PRs and the code. This is currently in pipeline and will take a while. You can keep an eye on the Firebase Android Open Source Repo.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ANR | Firebase - Google
Emulator Suite Security Rules Unit Testing Library. Overview · HostAndPort · RulesTestContext · RulesTestEnvironment · TestEnvironmentConfig. iOS — Swift.
Read more >
Performance Monitoring | React Native Firebase
Performance Monitoring allows you to gain insight into key performance characteristics within your React Native application. It provides a simple API to track ......
Read more >
Firebase incompatibility (Android) - New Relic Documentation
Conflicts, crashes, or errors will show when both the New Relic Android agent and Google's Firebase Performance Monitoring SDK are included within an...
Read more >
Firebase Performance Monitoring - Google Cloud Console
You use the Performance Monitoring SDK to collect performance data from your app, and then review and analyze that data in the Firebase...
Read more >
Monitor new features with Firebase Performance Monitoring
Learn how to use Performance Monitoring to investigate performance issues and monitor new feature rollouts, roll out a configuration change, and safely ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found