[Feature Flags] Bound exposure shutdown and own the existing EVP sender - #9353
Conversation
Preserve historical event routing while draining queued exposures safely during module shutdown. Environment: Datadog workspace
BenchmarksBenchmark execution time: 2026-10-01 23:25:09 Comparing candidate commit 9a8280d in PR branch Found 0 performance improvements and 12 performance regressions! Performance is the same for 60 metrics, 0 unstable metrics, 75 known flaky benchmarks, 49 flaky benchmarks without significant changes.
|
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (9353) and master. ✅ No regressions detected |
Motivation
Short-lived applications can lose exposures queued while another batch is being sent. Shutdown currently signals the worker without waiting for a final drain, and a concurrent evaluation can enqueue after shutdown begins.
flowchart LR E[Evaluations] --> Q[Exposure queue] S[Shutdown] -. missing final drain .-> Q Q --> A[Agent EVP v2]Changes and Decisions
Separate the existing local sender from exposure batching, give the Feature Flags module ownership of its lifetime, and dispose its settings subscriptions. Exposure shutdown rejects new enqueue attempts, drains queued events and waits at most ten seconds for the worker; a stalled network cannot indefinitely block termination.
This is the single-commit middle PR, based on discovery #9352. Both configuration modes keep their historical fixed EVP v2 route, headers and redirect defaults. There is no discovery-based selection or direct-intake activation here; the complete Agentless policy remains in #9235.
flowchart LR S[Shutdown] --> R[Reject new exposures] R --> F[Final queue drain] F --> T[Existing fixed-v2 sender] T --> A[Local Agent] F --> B[Bounded wait]