Repository navigation
fix(watchers): cap cron deadlines at the supported timer limit - #1148
Conversation
|
Deployment failed for project drydock-website with the following error: |
|
Warning Review limit reachedNext included review available in 10 minutes. View limit detailsLimit details: You’ve used all 2 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
@coderabbitai review Review the final cron deadline fix at 27845d5. Threat model: an operator-configured Docker update manager; valid long cron schedules must not overflow Node timers or falsely expire the single-flight guard. Hostile operators attacking their own machine are out of scope. Check the timer boundary and regression tests. This is the first actual review; the earlier attempt was rate-limited. |
🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
commit='27845d58eca18489031de30ce9d1d131a3f236b1'
git show --no-ext-diff --format=fuller --stat "$commit"
printf '\n--- changed paths ---\n'
git diff-tree --no-commit-id --name-status -r "$commit"
printf '\n--- TypeScript outlines for changed files ---\n'
git diff-tree --no-commit-id --name-only -r "$commit" \
| grep -E '\.(ts|tsx|js|jsx)$' \
| while IFS= read -r file; do
printf '\n### %s ###\n' "$file"
ast-grep outline "$file" --items all || true
done
printf '\n--- patch ---\n'
git show --no-ext-diff --format= "$commit"Length of output: 7933 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '--- docker-cron-watch.ts: source ---'
nl -ba app/watchers/providers/docker/docker-cron-watch.ts | sed -n '1,430p'
printf '%s\n' '--- docker-cron-watch.test.ts: source ---'
nl -ba app/watchers/providers/docker/docker-cron-watch.test.ts | sed -n '1,360p'
printf '%s\n' '--- timer and deadline call sites ---'
rg -n -C 4 --glob '*.{ts,tsx,js,jsx}' \
'(?:setTimeout|clearTimeout|CRON_WATCH_DEADLINE|getCronWatchDeadlineMs|getCronIntervalMs)\s*\(' \
app/watchers
printf '%s\n' '--- timer-limit constants and comments ---'
rg -n -C 3 --glob '*.{ts,tsx,js,jsx}' \
'(?:2147483647|2\*\*31|MAX_.*(?:TIMEOUT|TIMER)|timer ceiling|timer limit|overflow)' \
.Length of output: 1130 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '--- docker-cron-watch.ts: source ---'
sed -n '1,430p' app/watchers/providers/docker/docker-cron-watch.ts
printf '%s\n' '--- docker-cron-watch.test.ts: source ---'
sed -n '1,360p' app/watchers/providers/docker/docker-cron-watch.test.ts
printf '%s\n' '--- timer and deadline call sites ---'
rg -n -C 4 --glob '*.{ts,tsx,js,jsx}' \
'(?:setTimeout|clearTimeout|CRON_WATCH_DEADLINE|getCronWatchDeadlineMs|getCronIntervalMs)\s*\(' \
app/watchers || true
printf '%s\n' '--- timer-limit constants and comments ---'
rg -n -C 3 --glob '*.{ts,tsx,js,jsx}' \
'(?:2147483647|2\*\*31|MAX_.*(?:TIMEOUT|TIMER)|timer ceiling|timer limit|overflow)' \
. || trueLength of output: 131690 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '--- production cron-date provider ---'
rg -n -C 12 --glob '*.{ts,tsx,js,jsx}' \
'getNextScheduledRunDate\s*\(' \
app
printf '%s\n' '--- package manifests and Vitest configuration candidates ---'
fd -HI -t f '^(package\.json|vitest\.config\..*|vite\.config\..*)$' . \
| while IFS= read -r file; do
printf '\n### %s ###\n' "$file"
sed -n '1,260p' "$file"
done
printf '%s\n' '--- target test remainder: timer cleanup and cron interval tests ---'
sed -n '340,700p' app/watchers/providers/docker/docker-cron-watch.test.ts
printf '%s\n' '--- commit check ---'
git diff --check 27845d58eca18489031de30ce9d1d131a3f236b1^ 27845d58eca18489031de30ce9d1d131a3f236b1
git status --shortLength of output: 54244
The deadline is clamped before the only deadline Static review only. The sandbox does not permit test execution.
|
Fix the long-cron timer overflow found during images-manager QA. A monthly or longer schedule makes twice the interval exceed Node's timer ceiling. Node then schedules the deadline after 1 ms, clears the running scan guard, and logs a false stall.
Cap the deadline at 2147483647 ms. Keep the existing ten-minute floor and interval-based behavior below that ceiling. Add a real-timer monthly regression and boundary tests. The regressions fail against the old implementation, and all 33 watcher tests pass with the fix.
The full pre-push gate and backend build pass, including app and UI coverage. Add the fix to the not-yet-published rc.11 notes. This holds the maintenance cut until the fix is merged and both exact-source release workflows pass again. Forward ports are prepared for 1.7 and 1.8.
Threat model: ordinary operator cron configuration in a Docker-management service. No hostile local user or new scheduling subsystem is involved.