[PM-43815] feat: Make the dead letter sweep interval configurable - #8401
withinfocus wants to merge 1 commit into
Conversation
The sweep cadence was a hard-coded hour, so tuning how often the events processor drains integration dead letter queues meant a code change. A non-positive interval would leave no pause between sweeps, so the service logs it and keeps the default hour instead.
🤖 Bitwarden Claude Code ReviewOverall Assessment: APPROVE This change replaces the hard-coded one-hour sweep cadence in Code Review DetailsNo findings. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8401 +/- ##
=========================================
+ Coverage 0 64.63% +64.63%
=========================================
Files 0 2482 +2482
Lines 0 106388 +106388
Branches 0 9665 +9665
=========================================
+ Hits 0 68765 +68765
- Misses 0 35282 +35282
- Partials 0 2341 +2341 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-43815. Configuration follow-up to the dead letter retention work.
📔 Objective
DeadLetterCleanupHostedServiceswept the integration dead letter sub-queues on a hard-coded one-hour interval, so changing the cadence meant changing code. The interval now comes fromAzureServiceBus.DeadLetterSweepInterval, which sits next to theDeadLetterRetentionsetting that turns the sweep on at all. The default is the same hour it always was, so a deployment that leaves the setting alone sees no change.The service resolves the interval once at startup and checks it against the range
Task.Delayaccepts. Zero or a negative value would leave no pause between sweeps. A value past the roughly 49 daysTask.Delaytakes would throw and stop the events processor, and it would do that after the first sweep had already run, so the failure looks like a delayed crash rather than a bad startup. That upper bound is easy to cross by accident: configuration parses a bare number as days, so720entered for 720 hours becomes 720 days. Both cases log a warning and fall back to the default interval.Tests cover a configured value, the boundary, and each out-of-range case. One of them pins the maximum against what
Task.Delayactually accepts, so the constant cannot drift from the framework limit.