-
Notifications
You must be signed in to change notification settings - Fork 578
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ANR for Firebase Performance #1810
Comments
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight. |
Internally tracked at b/162031027 |
Hi carlonzo@, I think this might help in further debugging ContextSince FirebaseInitProvider initializes Firebase APIs at app startup time, not being able to initialize them properly (considering the inter-dependency) might cause conflicts. From the logs it looks like My hypothesis is that
Remedies
QuestionsQ1. Is Q2. How and when are you calling Useful References |
Hey @carlonzo. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically. If you have more information that will help us get to the bottom of this, just add a comment! |
Hi @ramanpreetSinghKhinda , I think I see what you are trying to say, but I cant find a reason we have this thread contention. I can copy paste the content of that
this is called inside the Application.onCreate. not from a Content provider. could that be the issue? About your questions: Thank you again for your time, |
Thanks @carlonzo From the stack trace it does looks like
If yes, how are you calling that API? Any Just to rule that case out, your app is not a Also just to clarify, you mentioned;
Can you point me out where exactly you looked? |
Thanks again @ramanpreetSinghKhinda No we do not directly call No our app is not a multi process app. the reason I suggested was an issue with Please let me know if I can provide more infos |
Hi @carlonzo, I'm still working on it. However, because of other priorities I am not yet able to spend time on validating this. As a remedy mentioned in #1810 (comment) can you revert to use the default way of Firebase initialization and see if that helps resolve your issue? The reason for that suggestion (see this) is when an Android app process is first started, there is well-defined order of operations:
Since Firebase Initialization (in default case) happens in the ContentProvider, I suspect having it manually initialized is causing a problem in this particular case. Note: In parallel we'll still keep on looking into why it's ANRing in this specialized use case. |
Hi @carlonzo, I am looking into making a lazy dependency towards the If all goes well we'll release the fix in the upcoming release or next of that. |
Hi @ramanpreetSinghKhinda thanks for that. We didn't switch to the initialisation using the content provider, yet, but I'm planning to do so this week. I'll let you know if I see improvements. Hopefully making making the initialization lazy will fix the thread contention. |
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. |
Thanks @ramanpreetSinghKhinda. looking forward to trying this. Is there a public PR I can look at that fixed the issue? |
Thanks for checking in @carlonzo Not currently unfortunately :| But once |
[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:
Other thread:
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 manuallyRelevant Code:
The text was updated successfully, but these errors were encountered: