-
Notifications
You must be signed in to change notification settings - Fork 205
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
Improve ANR error message information #553
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shaping up nicely!
bugsnag-plugin-android-anr/src/main/java/com/bugsnag/android/AnrPlugin.kt
Outdated
Show resolved
Hide resolved
bugsnag-plugin-android-anr/src/main/java/com/bugsnag/android/AnrPlugin.kt
Outdated
Show resolved
Hide resolved
bugsnag-plugin-android-anr/src/main/java/com/bugsnag/android/AnrPlugin.kt
Outdated
Show resolved
Hide resolved
bugsnag-plugin-android-anr/src/main/java/com/bugsnag/android/AnrPlugin.kt
Outdated
Show resolved
Hide resolved
5673b0a
to
b074b3f
Compare
b074b3f
to
e52c7cb
Compare
71db496
to
4486f32
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This changeset should bring the poll interval in AppNotRespondingMonitor
down from 5s to 2s or so. In the worst case, the ANR dialog could pop before the details collector spins up (since it could be up to 5s after the ANR is initially detected).
bugsnag-plugin-android-anr/src/androidTest/java/com/bugsnag/android/AnrDetailsCollectorTest.kt
Outdated
Show resolved
Hide resolved
bugsnag-plugin-android-anr/src/main/java/com/bugsnag/android/AnrDetailsCollector.kt
Outdated
Show resolved
Hide resolved
bugsnag-plugin-android-anr/src/main/java/com/bugsnag/android/AnrDetailsCollector.kt
Outdated
Show resolved
Hide resolved
@kattrali thanks for the review comments, I've updated the implementation and also added an |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This changeset should bring the poll interval in AppNotRespondingMonitor
down from 5s to 2s or so. In the worst case, the ANR dialog could pop before the details collector spins up (since it could be up to 5s after the ANR is initially detected).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In-person conversation
The current interval is 5ms not 5s, which is good.
bugsnag-android-core/src/androidTest/java/com/bugsnag/android/BugsnagExceptionTest.kt
Outdated
Show resolved
Hide resolved
c6dd9b7
to
2493924
Compare
Goal
Android records a cause for an ANR in the
ProcessRecord
for the app process. Adding the message to error reports will improve context and differentiate timed out input dispatching from failing to respond to a broadcast event.Changeset
When
SIGQUIT
is caught bugsnag creates anError
which captures the stacktrace. Rather than sending this report immediately, the notifier now polls theActivityManager
for 30 seconds in an attempt to access process error information.Once this information is available the notifier updates the error message to the value of
ProcessErrorStateInfo#shortMsg
, resulting in a stacktrace that looks like this:Important Note: Android has a concept of 'silent ANRs' which occur when the process is in the background. For silent ANRs, the process is killed immediately without showing a dialog to the user. With this changeset Bugsnag will no longer detect silent ANRs, which may reduce 'overreporting' that has been raised as feedback.
Other changes
name
andmessage
on aBugsnagException
, and added public methods for doing this via theError
object alsoError
andExceptions
to always use aBugsnagException
field. RegularThrowables
are now wrapped into aBugsnagException
Tests