Skip to content

RUM-16092: Atomically write NDK crash logs + catch NumberFormatException#3425

Merged
kikoveiga merged 2 commits into
developfrom
kikoveiga/rum-16092/catch-NumberFormatException
May 26, 2026
Merged

RUM-16092: Atomically write NDK crash logs + catch NumberFormatException#3425
kikoveiga merged 2 commits into
developfrom
kikoveiga/rum-16092/catch-NumberFormatException

Conversation

@kikoveiga

@kikoveiga kikoveiga commented May 8, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

  • Switch write_crash_report to an atomic write + fsync + rename pattern, so the NDK crash_log file on disk is never observable as zero-filled or torn when the process dies between the buffered write and the kerne's writeback (root cause of the NumberFormatException).
  • Add a catch (e: NumberFormatException) in NdkCrashLogDeserializer so corrupt files are handled gracefully.

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)

@kikoveiga
kikoveiga force-pushed the kikoveiga/rum-16092/catch-NumberFormatException branch 2 times, most recently from d460c7b to 7853e1c Compare May 8, 2026 15:22
@kikoveiga
kikoveiga marked this pull request as ready for review May 8, 2026 15:26
@kikoveiga
kikoveiga requested review from a team as code owners May 8, 2026 15:26
@kikoveiga kikoveiga self-assigned this May 8, 2026
@codecov-commenter

codecov-commenter commented May 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.71429% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 72.26%. Comparing base (00897b2) to head (71f21a2).

Files with missing lines Patch % Lines
...og/android/ndk/internal/NdkCrashLogDeserializer.kt 85.71% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3425      +/-   ##
===========================================
+ Coverage    72.20%   72.26%   +0.06%     
===========================================
  Files          964      964              
  Lines        35554    35561       +7     
  Branches      5922     5922              
===========================================
+ Hits         25669    25696      +27     
+ Misses        8269     8256      -13     
+ Partials      1616     1609       -7     
Files with missing lines Coverage Δ
...in/com/datadog/android/ndk/internal/NdkCrashLog.kt 95.83% <ø> (ø)
...og/android/ndk/internal/NdkCrashLogDeserializer.kt 65.38% <85.71%> (+7.49%) ⬆️

... and 33 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

0xnm
0xnm previously approved these changes May 11, 2026

@0xnm 0xnm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While it prevents SDK from crashing, the underlying problem stays - we don't still know why it happens.

If you check this telemetry, you will find more errors, which may be related.

Do you plan any further investigation?

jonathanmos
jonathanmos previously approved these changes May 13, 2026
ambushwork
ambushwork previously approved these changes May 26, 2026
@kikoveiga
kikoveiga dismissed stale reviews from ambushwork, jonathanmos, and 0xnm via 2534bd3 May 26, 2026 15:07
@kikoveiga
kikoveiga force-pushed the kikoveiga/rum-16092/catch-NumberFormatException branch from 7853e1c to 2534bd3 Compare May 26, 2026 15:07
@datadog-datadog-prod-us1

This comment has been minimized.

@kikoveiga kikoveiga changed the title RUM-16092: Catch NumberFormatException in NdkCrashLog.kt RUM-16092: Atomically write NDK crash logs + Catch NumberFormatException May 26, 2026
@kikoveiga kikoveiga changed the title RUM-16092: Atomically write NDK crash logs + Catch NumberFormatException RUM-16092: Atomically write NDK crash logs + catch NumberFormatException May 26, 2026
0xnm
0xnm previously approved these changes May 26, 2026
Comment thread features/dd-sdk-android-ndk/src/main/cpp/datadog-ndk.cpp
@kikoveiga
kikoveiga force-pushed the kikoveiga/rum-16092/catch-NumberFormatException branch from 2534bd3 to 2a2abf5 Compare May 26, 2026 16:14
@kikoveiga
kikoveiga requested a review from 0xnm May 26, 2026 16:28
@kikoveiga
kikoveiga merged commit 589e3b4 into develop May 26, 2026
27 checks passed
@kikoveiga
kikoveiga deleted the kikoveiga/rum-16092/catch-NumberFormatException branch May 26, 2026 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants