-
Notifications
You must be signed in to change notification settings - Fork 61
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
RUM-2928: Report all threads in case of crash #1848
RUM-2928: Report all threads in case of crash #1848
Conversation
72153f1
to
68aa1ae
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## develop #1848 +/- ##
===========================================
+ Coverage 83.41% 83.58% +0.16%
===========================================
Files 467 470 +3
Lines 16530 16567 +37
Branches 2498 2492 -6
===========================================
+ Hits 13788 13846 +58
+ Misses 2050 2046 -4
+ Partials 692 675 -17
|
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.
Nice work !
val thread = it.key | ||
val isCrashedThread = thread == crashedThread | ||
val stack = if (isCrashedThread) { | ||
crashException.loggableStackTrace() |
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.
what is the difference between using crashExceptiom.loggableStackTrace
and thread.stackTrae.loggableStackTrace
and why not just using the later here.
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.
The difference is that one reads a stacktrace from an exception, while the latter captures the current stacktrace of a given thread.
If the thread is the crashedThread, it means that this is the current one, and so capturing the current stacktrace would report the state as the DDExceptionHandler
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.
yes, @xgouchet explained it precisely :)
dd-sdk-android-core/src/main/kotlin/com/datadog/android/core/feature/event/JvmCrash.kt
Show resolved
Hide resolved
val thread = it.key | ||
val isCrashedThread = thread == crashedThread | ||
val stack = if (isCrashedThread) { | ||
crashException.loggableStackTrace() |
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.
The difference is that one reads a stacktrace from an exception, while the latter captures the current stacktrace of a given thread.
If the thread is the crashedThread, it means that this is the current one, and so capturing the current stacktrace would report the state as the DDExceptionHandler
68aa1ae
to
f28e295
Compare
What does this PR do?
This PR will make all threads to be reported in case of the application crash. Data will be sent in the
error.threads
property for both Logs and RUM, and will include the following:name
- thread namecrashed
- if this particular thread crashed or not (it will be the thread for which we caught an exception).state
- thread state at the moment of the crash, according to theThread.State
stack
- stacktrace of the thread at the crash moment, for the crashed thread it will exception stacktrace instead.Review checklist (to be filled by reviewers)