chore(components): migrate DogStatsD source to full supervision - #2385
chore(components): migrate DogStatsD source to full supervision#2385tobz wants to merge 1 commit into
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Binary Size Analysis (Agent Data Plane)Baseline: 0384c33 · Comparison: 5d45df0 · diff ✅ Binary size difference within thresholdChanges by Module
Detailed Symbol Changes |
Regression Detector (Agent Data Plane)Run ID: Optimization Goals: ✅ No significant changes detectedFine details of change detection per experiment (5)Experiments configured
Bounds Checks: ✅ Passed (5)
ExplanationA change is flagged as a regression when |Δ mean %| > 5.00% in the regressing direction for its optimization goal AND SMP marks the experiment as a regression ( |
fabcbea to
51f8d08
Compare
c6e5b1d to
b791a89
Compare
51f8d08 to
6a54d37
Compare
b791a89 to
a75a48a
Compare
6a54d37 to
5b6bf70
Compare
5b6bf70 to
5d45df0
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5d45df06eb
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if let Err(e) = spawner | ||
| .spawn_interruptible("packet_forwarder", forwarder.run(packets_rx, self.metrics.clone())) | ||
| .await |
There was a problem hiding this comment.
Drain queued forwarding packets before supervisor exit
When the component supervisor begins its concurrent shutdown, spawn_interruptible drops ConnectedPacketForwarder::run at its current await point, so any DogStatsD messages already accepted into packets_rx are discarded instead of being sent. The previous detached loop remained alive until the listener/handler-held senders closed and then drained the channel; use a non-interruptible child that finishes after channel closure, or explicitly coordinate this queue's drain before shutdown completes.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Shutdown can stop the packet forwarder before DogStatsD decoders finish their lossless drain. This can lose queued metrics.
🤖 Datadog Autotest · Commit 5d45df0 · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest
| forwarder.run(packets_rx, self.metrics.clone()), | ||
| ); | ||
| if let Err(e) = spawner | ||
| .spawn_interruptible("packet_forwarder", forwarder.run(packets_rx, self.metrics.clone())) |
There was a problem hiding this comment.
Keep the forwarder active during queue drain
DogStatsD packet forwarding can lose metrics during shutdown.
Assertion details
- Input: Packet forwarding is enabled. Shutdown starts while a decoder or the forwarder queue still has packets.
- Expected:
The forwarder stays active until all packet senders close. It sends all queued packets before it stops. - Actual:
The supervisor stops the interruptible forwarder at once. The decoders continue their queue drain. Later sends fail, and packets already in the forwarder queue are lost. Make the forward loop non-interruptible until all senders close. Update the forwarder shutdown tests to release the sender before supervisor shutdown. Add coverage for queue drain during shutdown.
Was this helpful? React 👍 or 👎
🤖 Datadog Autotest · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest

Summary
This PR is the third of many (hopefully just a few) for converting components to spawn all of their child tasks under their dedicated supervisor to fully unify task execution in Saluki under the supervision tree model, specifically handling the DogStatsD source.
We skipped the DogStatsD source in the initial sources/relay migration PR because it's very beefy, and deserves its own standalone PR.
Change Type
How did you test this PR?
Existing tests.
References
DADP-2