Commit f56490b
feat: minimal tombstone integration (#4933)
* feat: minimal tombstone integration (disabled by default, options internal)
* redo a seemingly missed spotlessApply
* use non-plural option + mark integration also as internal + update API
* init size exceptions since we know we only need one
Co-authored-by: Markus Hintersteiner <[email protected]>
* move `instructionAddressAdjustment` to `SentryStackTrace`
* add copyright notice to tombstone.proto
* add historical tombstone option
* looks like we need to add a TombstoneEventProcessor anyway.
* ...so let's add it to the options if the SDK supports it (adapt to >= S, since that is the earliest version where `REASON_CRASH_NATIVE` provides tombstones via the `traceInputStream`)
* Adapt `AndroidEnvelopeCache` to also write Tombstone timestamp markers
* Integrate handling of historical Tombstone option + last tombstone marker
This currently does not work:
While we now can optionally enable reporting of "historical" tombstones, by making the `TombstoneHint` `Backfillable` it will automatically be enriched by the `ANRv2EventProcessor` which is currently the only `BackfillingEventProcessor`.
The `ANRv2EventProcessor` is partially written in way that is potentially generic for events with `Backfillable` hints, but other parts are enriching as if those are always were ANRs, which up to now was true, but with Tombstones that assumption now breaks.
Next Steps:
* There is considerable duplication between the ANRv2Integration and TombstoneIntegration
* sprinkle with TODOs to highlight next PR steps
* fix typo
* implement TombstoneParser as Closable and close the tombstone stream
* tighten code with final and null annotations.
* eliminate obsolete null check
* Deduplicate ApplicationExitInfo handling for corresponding Integrations via HistoryDispatcher
* also update api dumps and formatting for sentry changes
* update tombstone message construction
* fix abortMessage check
* convert AnrV2EventProcessor to a more generic ApplicationExitInfoEventProcessor
this handles all events with Backfillable hint, but adds an interface HintEnricher, to allow hint-specific enrichment (like for ANRs) before and after the generic backfilling happened.
* reintroduce, update and correct old inline docs where they make sense.
* remove obsolete TombstoneEventProcessor
* clean up tombstone error handling
* convert ApplicationExitInfoHistoryDispatcher.removeLatest() to use an iterator instead of for-each
* add TombstoneIntegrationTest
* replace assertions with explicit RuntimeException
* use test base class for AEI
* remove obsolete TODO RE: mechanism change
* clarify open TODO RE: AbnormalExit discriminator for ANR hints
* refactor instructionAddressAdjustment from String to enum
* deduplicate hex formatting of addresses and TombstoneParser
* adapt tryEndPreviousSession() in EnvelopeCache to NativeCrashExit hint
* move isBackgroundAnr() to the AnrHintEnricher since it is only used there.
* revert method-references back to lambdas
* clean up exception assignment in TombstoneParser
* properly format the debug-id as an OLE GUID
* remove obsolete equality between code-id and debug-id
* ensure that errors in the char->digit conversion is also handled
* fix debugId/codeId look-up and checks in TombstoneIntegrationTest
* make movePreviousSession idempotent wrt the previous session
* reuse existing codeId -> debugId conversion instead of adding a new converter
* make PreviousSessionFinalizer aware of tombstone handled sessions and add crashedLastRun
* bump SDK config for TombstoneIntegrationTest to version 31 (S)
* add changelog entry
* retrieve test tombstone.pb fixture as a resource rather than a file path.
* attribute pb to be binary and re-commit the non-corrupted tombstone.pb
* reset crashedLastRun in PreviousSessionFinalizer and add test-case
* format
* fix Ok Session termination test
* format
* clarify comments and variable names in PreviousSessionFinalizer
* only enable distribution and sizeAnalysis if the SENTRY_AUTH_TOKEN environment variable is present and `isNotBlank()``
* compress tombstone test resource to reduce its repo weight down to less than 20%
* add round-trip serialization test for `instructionAddressAdjustment`
---------
Co-authored-by: Markus Hintersteiner <[email protected]>1 parent 2387c2c commit f56490b
File tree
35 files changed
+2575
-820
lines changed- gradle
- sentry-android-core
- api
- src
- main
- java/io/sentry/android/core
- cache
- internal
- threaddump
- tombstone
- util
- proto/io/sentry/android/core/internal/tombstone
- test
- java/io/sentry/android/core
- internal/tombstone
- resources
- sentry-android-integration-tests/test-app-size
- sentry
- api
- src
- main/java/io/sentry
- cache
- hints
- protocol
- test/java/io/sentry
- cache
- protocol
35 files changed
+2575
-820
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
4 | 6 | | |
5 | 7 | | |
6 | 8 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
18 | 24 | | |
19 | 25 | | |
20 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| |||
60 | 61 | | |
61 | 62 | | |
62 | 63 | | |
| 64 | + | |
63 | 65 | | |
64 | 66 | | |
65 | 67 | | |
| |||
139 | 141 | | |
140 | 142 | | |
141 | 143 | | |
| 144 | + | |
| 145 | + | |
142 | 146 | | |
143 | 147 | | |
144 | 148 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | 144 | | |
152 | 145 | | |
153 | 146 | | |
| |||
203 | 196 | | |
204 | 197 | | |
205 | 198 | | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
| |||
352 | 352 | | |
353 | 353 | | |
354 | 354 | | |
| 355 | + | |
| 356 | + | |
355 | 357 | | |
356 | 358 | | |
357 | 359 | | |
| |||
381 | 383 | | |
382 | 384 | | |
383 | 385 | | |
| 386 | + | |
| 387 | + | |
384 | 388 | | |
385 | 389 | | |
386 | 390 | | |
| |||
469 | 473 | | |
470 | 474 | | |
471 | 475 | | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
472 | 499 | | |
473 | 500 | | |
474 | 501 | | |
| |||
495 | 522 | | |
496 | 523 | | |
497 | 524 | | |
| 525 | + | |
498 | 526 | | |
| 527 | + | |
| 528 | + | |
499 | 529 | | |
500 | 530 | | |
501 | 531 | | |
502 | 532 | | |
| 533 | + | |
503 | 534 | | |
504 | 535 | | |
505 | 536 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
83 | 84 | | |
84 | 85 | | |
85 | 86 | | |
| 87 | + | |
86 | 88 | | |
87 | 89 | | |
88 | 90 | | |
| |||
109 | 111 | | |
110 | 112 | | |
111 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
188 | 189 | | |
189 | 190 | | |
190 | 191 | | |
191 | | - | |
| 192 | + | |
| 193 | + | |
192 | 194 | | |
193 | 195 | | |
194 | 196 | | |
| |||
373 | 375 | | |
374 | 376 | | |
375 | 377 | | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
376 | 382 | | |
377 | 383 | | |
378 | 384 | | |
| |||
0 commit comments