You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: [SLES-2810] prune sorted_reparenting_info on context release to stop warning flood (#1161)
## Summary
- **Root cause:** After `on_platform_report` removes a context from `context_buffer`, the corresponding `ReparentingInfo` entry was left in `sorted_reparenting_info` indefinitely (capacity 500). Every subsequent trace batch caused `update_reparenting` to iterate all stale entries and emit a `WARN` for each one, producing a flood of `"Mismatched request info. Context not found for request_id"` messages in CloudWatch.
- **Fix:** Call `sorted_reparenting_info.retain(...)` immediately after `context_buffer.remove(request_id)` in `on_platform_report` to prune the completed invocation's entry.
- **Tests:** Two regression tests added — one verifying the entry is pruned after `on_platform_report`, one reproducing the exact production sequence (invoke → add_reparenting → report → trace batch) to confirm stale entries no longer appear in `get_reparenting_info()`.
Fixes https://datadoghq.atlassian.net/browse/SLES-2810
## Test plan
- [x] `cargo test test_reparenting_info_pruned_after_on_platform_report` passes
- [x] `cargo test test_update_reparenting_ignores_completed_invocations` passes
- [x] Full lifecycle test suite: 218 passed, 0 failed
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: tianning.li <tianning.li@datadoghq.com>
0 commit comments