Replace the bars task's phantom retry with a repeating trigger - #111
Merged
Conversation
WINDOWS_SCHEDULING.md built its whole retry story on Task Scheduler's "if the task fails, restart every N minutes". That setting fires when the scheduler cannot LAUNCH the action, not when the action exits non-zero, so it never once retried a --require-final defer. Measured on the reference box, which had RestartCount 20 / RestartInterval PT15M set on the bars task: from 2026-08-12 to 08-15 the action returned exit 1 and the task was launched exactly once each night -- four consecutive nights, no retry, no bars captured. Events 111 and 322-324, the restart and queue events, never appeared at all. The store caught up on 08-16 when a run finally found Norgate ahead of it, and that self-heal is why the failure stayed invisible: the data was never permanently wrong, only a day late, so --check a week later looked fine and nothing alerted. The fix is a repetition on the trigger, which fires regardless of what the previous run returned. schtasks sets it on a daily schedule with /RI and /DU, verified to emit the same Repetition element the Friday COT poller has always used -- which is why that task has worked all along while the bars task did not. The correct pattern was already on the page; the bars task just was not on it. Also corrected downstream of the same premise: - The Last Result guidance now says the opposite of what it did. Under repetition a healthy night ENDS non-zero, because the repeat that captured succeeded hours earlier and every repeat after it defers. - The exit-code callout for run-prices.cmd no longer claims an unguarded --metadata strands the task until tomorrow. It does not any more; what it destroys is the only per-run signal separating a capture from a defer. - sync-store.cmd's exit-code normalisation rationale no longer cites a restart loop that does not exist. The warning keeps the dates and event IDs rather than quietly swapping the recommendation, because the failure mode is invisible enough that someone will otherwise re-derive it from scratch. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
WINDOWS_SCHEDULING.mdbuilt its whole retry story on Task Scheduler's "if the task fails, restart every N minutes." That setting fires when the scheduler cannot launch the action — not when the action exits non-zero — so it never once retried a--require-finaldefer.Evidence
Measured on the producer box, which had
RestartCount 20/RestartInterval PT15Mset on the bars task:Four consecutive nights, no retry, no bars captured. Events 111 and 322–324 — the restart and queue events — never appeared at all. The store caught up on 08-16, when a run finally found Norgate ahead of it.
That self-heal is why it stayed invisible: the data was never permanently wrong, only a day late, so
--checka week later looked fine and nothing alerted.Fix
A repetition on the trigger, which fires regardless of what the previous run returned.
schtaskssets it on a daily schedule with/RIand/DU, verified to emit the same<Repetition>element the Friday COT poller has always used — which is why that task worked all along while the bars task did not. The correct pattern was already on the page; the bars task just wasn't on it.Also corrected, downstream of the same premise
Last Resultguidance now says the opposite of what it did. Under repetition a healthy night ends non-zero, because the repeat that captured succeeded hours earlier and every repeat after it defers. A redLast Resulton the bars task is no longer evidence of anything on its own.run-prices.cmdno longer claims an unguarded--metadatastrands the task until tomorrow. It doesn't any more — what it destroys is the only per-run signal separating a capture from a defer.sync-store.cmd's exit-code normalisation rationale no longer cites a restart loop that doesn't exist.The warning keeps the dates and event IDs rather than quietly swapping the recommendation, because the failure mode is invisible enough that someone will otherwise re-derive it from scratch.
Applied to the producer box
cotdata pricesconverted to a repeating trigger (15 min × 5 h); verified firing on exit 1.cotdata COT (catch-up)had its deadRestartOnFailureelement removed. It needs no polling —cotdata-cot --cot-allexits 0 on a pre-release no-op — and being daily and idempotent, the next morning's run is its own retry.Note for reviewers
The unmerged branch
claude/scheduling-doc-finals-gatetouches this same file and looks superseded: its finals-gate rewrite already landed inmainin evolved form, and merging it now would re-introduce the restart-on-failure paragraph this PR removes, plus pre-ADR-0007cotdata-prices --pricescommands. Worth closing rather than merging.🤖 Generated with Claude Code