Skip to content

Fix evaluations feature startup deadlock#3186

Merged
0xnm merged 1 commit into
developfrom
nogorodnikov/fix-evaluations-startup-deadlock
Feb 18, 2026
Merged

Fix evaluations feature startup deadlock#3186
0xnm merged 1 commit into
developfrom
nogorodnikov/fix-evaluations-startup-deadlock

Conversation

@0xnm

@0xnm 0xnm commented Feb 18, 2026

Copy link
Copy Markdown
Member

What does this PR do?

The following code causes a deadlock (we are reading context while it is updated) preventing sample app to start

val service = currentContext?.service
?: (sdkCore as? InternalSdkCore)?.getDatadogContext()?.service

This PR fixes it by moving core context read to the event write stage.

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 a review from a team as a code owner February 18, 2026 09:11
@0xnm
0xnm force-pushed the nogorodnikov/fix-evaluations-startup-deadlock branch from fc58dc7 to 2fc5438 Compare February 18, 2026 09:18
@0xnm
0xnm requested review from dd-oleksii and typotter February 18, 2026 09:19
@datadog-datadog-prod-us1

This comment has been minimized.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.00000% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.26%. Comparing base (b79d675) to head (2fc5438).

Files with missing lines Patch % Lines
...tadog/android/flags/internal/EvaluationsFeature.kt 0.00% 4 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #3186   +/-   ##
========================================
  Coverage    71.26%   71.26%           
========================================
  Files          929      929           
  Lines        34447    34442    -5     
  Branches      5816     5813    -3     
========================================
- Hits         24546    24543    -3     
- Misses        8252     8256    +4     
+ Partials      1649     1643    -6     
Files with missing lines Coverage Δ
...ndroid/flags/internal/EvaluationEventsProcessor.kt 95.16% <100.00%> (-0.08%) ⬇️
...s/internal/aggregation/EvaluationAggregationKey.kt 100.00% <100.00%> (ø)
...internal/aggregation/EvaluationAggregationStats.kt 100.00% <100.00%> (ø)
...flags/internal/aggregation/EvaluationAggregator.kt 100.00% <100.00%> (ø)
...gs/internal/storage/EvaluationEventRecordWriter.kt 100.00% <100.00%> (ø)
...tadog/android/flags/internal/EvaluationsFeature.kt 20.83% <0.00%> (+1.97%) ⬆️

... and 44 files with indirect coverage changes

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

@typotter typotter left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thans Nikita!

@0xnm
0xnm merged commit 9970e2d into develop Feb 18, 2026
26 checks passed
@0xnm
0xnm deleted the nogorodnikov/fix-evaluations-startup-deadlock branch February 18, 2026 12:46
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.

4 participants