Skip to content

RUM-10422: Handle the case when DatadogContext is requested when SDK is getting deinitialized#2740

Merged
0xnm merged 1 commit into
nogorodnikov/rum-8170/feature-context-syncfrom
nogorodnikov/rum-10422/handle-case-of-sdk-deinit-when-context-requested
Jun 20, 2025
Merged

RUM-10422: Handle the case when DatadogContext is requested when SDK is getting deinitialized#2740
0xnm merged 1 commit into
nogorodnikov/rum-8170/feature-context-syncfrom
nogorodnikov/rum-10422/handle-case-of-sdk-deinit-when-context-requested

Conversation

@0xnm

@0xnm 0xnm commented Jun 19, 2025

Copy link
Copy Markdown
Member

What does this PR do?

There is an edge case when calling withWriteContext/withContext/... if we are in the process of SDK deinitialization.

When starting the task submitted to the context processing queue we would like to check if CoreFeature is still alive.

Normally, in the CoreFeature.stop we are calling shutdownNow for the executors which interrupts the threads, but just in case if the stop approach is different in the future we just put one more check.

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)

@0xnm
0xnm requested review from a team as code owners June 19, 2025 09:24
@codecov-commenter

codecov-commenter commented Jun 19, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.

Project coverage is 69.82%. Comparing base (e531526) to head (0ed3955).

Files with missing lines Patch % Lines
...in/com/datadog/android/core/internal/SdkFeature.kt 66.67% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@                             Coverage Diff                             @@
##           nogorodnikov/rum-8170/feature-context-sync    #2740   +/-   ##
===========================================================================
  Coverage                                       69.82%   69.82%           
===========================================================================
  Files                                             824      824           
  Lines                                           30933    30934    +1     
  Branches                                         5188     5191    +3     
===========================================================================
+ Hits                                            21597    21598    +1     
+ Misses                                           7875     7864   -11     
- Partials                                         1461     1472   +11     
Files with missing lines Coverage Δ
...in/com/datadog/android/core/internal/SdkFeature.kt 93.33% <66.67%> (-0.39%) ⬇️

... and 35 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 merged commit 6375758 into nogorodnikov/rum-8170/feature-context-sync Jun 20, 2025
24 checks passed
@0xnm
0xnm deleted the nogorodnikov/rum-10422/handle-case-of-sdk-deinit-when-context-requested branch June 20, 2025 07:22
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.

3 participants