-
-
Notifications
You must be signed in to change notification settings - Fork 446
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 in HostnameCache.updateCache while initialising SDK #2153
Comments
@vibin, is this happening every time or only under certain conditions? |
@philipphofmann According to Crashlytics, this is happening for 0.035% of our DAU. But, Crashlytics only tracks ANRs in Android 10 and 11. I'm not able to reproduce this issue, so not sure of the conditions (but it's only happening in background, in production) |
The problem seems to be here sentry-java/sentry/src/main/java/io/sentry/HostnameCache.java Lines 118 to 119 in 9679043
I'm not sure what is causing this. Thanks for reporting this, we need to look into this. I can't give you an ETA at the moment. |
|
This is only read if |
hm, it was definitely hitting the debug breakpoint for me, will re-check |
So it's actually being called, because
what if we lazily initialize
|
@romtsn we're also closing the |
yeah, we should keep the field 👍 |
Thanks! |
@vibin is initializing sentry on main thread, isn't that the root cause of the ANR? |
yes, we're. But initialising sentry on main thread is a valid usecase. The root cause seems to be HostNameCache |
no really, initializing anything that can take some time, especially from external library which can change without notice, is not valid |
Integration
sentry-android
Build System
Gradle
AGP Version
7.0.4
Proguard
Enabled
Version
5.7.4
Steps to Reproduce
Initialise the SDK
Expected Result
SDK to initialise without causing any ANR.
Actual Result
ANR is thrown during initialisation.
ANR type: background ANR
OS: Android 10 and 11
Sentry init configuration:
The text was updated successfully, but these errors were encountered: