feat(watchdog): duration-drift detection to front-run task OOM/timeout #68
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
gertjan/bodega!68
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/watchdog-duration-drift"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The watchdog only ever inspected each task's single most recent run
(staleness, failed status, low coverage) — all post-mortem signals that
fire after a task has already missed or crashed. But task_runs already
stores duration_seconds for every run, and a task creeping toward OOM or
timeout gets slower for several runs first.
Add TaskRunRepository.get_duration_drift(): a window query comparing the
latest successful run to the rolling median of the prior N successes
(latest excluded from its own baseline; returns None when history is too
thin to judge). The watchdog opts a task in via a new optional
max_duration_ratio key and raises a "Duration drift" issue through the
existing consolidated-alert path when latest/baseline exceeds it.
Wired up for scores_refresh and correlation_refresh (the heavy analytics
tasks; correlation_refresh has a prior interrupted-run incident). Tasks
without the key are unaffected — fully opt-in, no schema change.
Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com