Repository navigation
feat: diff 50 shadow channels at a time with a four-hour run budget - #5055
Conversation
Refs linuxfoundation/lfx-cdp-insights-ops#833 Signed-off-by: Mouad BANI <mouad-mb@outlook.com>
PR SummaryMedium Risk Overview Schedule registration refactors the start-workflow action into a shared constant and, when the schedule already exists ( Adds a workflow unit test that asserts batched concurrency (peak 50 in flight over 120 channels) and that one channel failure is counted without aborting the run. Reviewed by Cursor Bugbot for commit 2666125. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
🟢 Approval recommended
The changes are focused, regression coverage addresses the concurrency behavior, and no blocking issues were identified.
No open issues 🎉
What changed in this PR
Scales nightly shadow diffs to support the upcoming mirror sweep and a larger channel pool.
Changes:
- Raises channel concurrency from 10 to 50.
- Extends the execution timeout to four hours and reconciles existing schedules.
- Adds coverage for concurrency limits and continued processing after a channel failure.
| File | Description |
|---|---|
| services/apps/connectors_worker/src/workflows/shadowDiff.ts | Exports and raises the concurrency limit. |
| services/apps/connectors_worker/src/workflows/shadowDiff.test.ts | Tests 120 channels, peak concurrency, and failure counting. |
| services/apps/connectors_worker/src/schedules/shadowDiff.ts | Updates the timeout for new and existing schedules. |
Review effort: Balanced
Why
The nightly
shadowDiffruns 10 channels at a time under a 30-minute execution timeout. That fits today's 110 mirrored repos (6-8 minutes a night) but not the automated mirror sweep that follows this PR: its first night alone brings the pool to ~610 channels, which is 35-45 minutes at the current fan-out. The diff would time out, write nosync_diff_summaryrows for the day, and the switch sweep's gate would then refuse every repo for lack of a diffed day.What
CHANNEL_CONCURRENCY10 → 50 inworkflows/shadowDiff.ts(exported, sized for ~5,000 channels in about an hour).connectors-shadow-diffscheduleworkflowExecutionTimeout30 minutes → 4 hours.ScheduleAlreadyRunningthe worker now reconciles the existing schedule's action (same pattern as the docs-readiness schedules), so the new timeout applies to the live schedule after deploy instead of only on first creation.Rollout
Deploy before the mirror sweep (next PR) runs its first night.
Refs linuxfoundation/lfx-cdp-insights-ops#833