[FA] Serialize UPDATER_TASK execution and fix no-op config version clearing#2956
Open
[FA] Serialize UPDATER_TASK execution and fix no-op config version clearing#2956
Conversation
…earing - Add taskMu mutex + handleTask method to serialize concurrent RC task callbacks, preventing races in setTaskState (matches datadog-agent single-writer model) - Clear experiment config version on no-op stop/promote so the backend can issue new tasks after a timeout or already-terminal experiment state Extracted from #2952 (excludes the parseTaskNSN / namespace-from-task refactor).
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2956 +/- ##
==========================================
+ Coverage 41.38% 41.45% +0.07%
==========================================
Files 327 327
Lines 28952 28961 +9
==========================================
+ Hits 11982 12006 +24
+ Misses 16109 16094 -15
Partials 861 861
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
|
🎯 Code Coverage (details) 🔗 Commit SHA: 17d9deb | Docs | Datadog PR Page | Give us feedback! |
Hitsuji-M
approved these changes
Apr 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Ports three fixes from #2952 that are independent of the
parseTaskNSN/ namespace-from-task refactor.1. Serialize UPDATER_TASK execution (
taskMu+handleTask)Adds a
taskMu sync.MutextoDaemonand extracts ahandleTaskmethod that holds the lock for the full lifecycle of one task (RUNNING → DONE/ERROR/INVALID_STATE). The inline block inStart()is replaced withreturn d.handleTask(ctx, req).Why: Multiple concurrent RC callbacks can race on
setTaskState. This matches the datadog-agent's single-writer model.2. No-op stop clears experiment config version
When
canStopreturnsisNoOp=true(e.g. spec already rolled back due to timeout), the experiment config version is now cleared before returning.Why: Without this, the backend could not issue new tasks after a timeout-triggered rollback.
3. No-op promote clears experiment config version
Same fix for
promoteDatadogAgentExperimentwhen the experiment is already in a terminal state.Checklist
bug,enhancement,refactoring,documentation,tooling, and/ordependenciesqa/skip-qalabel