Release v1.1.0-rc.8: upgrade legacy scheduler state#48
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 26e3079b92
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let recovered = db | ||
| .fail_stale_scheduler_runs(Local::now() - ChronoDuration::hours(STALE_SCHEDULER_RUN_HOURS)) | ||
| .await?; |
There was a problem hiding this comment.
Recheck abandoned runs after they cross the cutoff
When the daemon restarts less than 24 hours after a scheduler job was interrupted, this startup-only query deliberately leaves that run in running; because the recovery is never called from the tick loop, the abandoned record remains running even after it becomes older than 24 hours and may stay that way until another restart. Run the stale check periodically, or otherwise distinguish live concurrent jobs from runs abandoned by this daemon instance.
Useful? React with 👍 / 👎.
| if rule.safety_backup != cfg.backup.enabled { | ||
| rule.safety_backup = cfg.backup.enabled; | ||
| if let Some(id) = rule.id { | ||
| db.update_scheduler_rule(id, &rule).await?; |
There was a problem hiding this comment.
Update only the legacy safety field during migration
For an rc.3–rc.6 database whose legacy scan was edited with values accepted by those releases but rejected by the newer whole-rule validator (for example, an oversized misfire_grace_minutes or max_delete), changing safety_backup here calls update_scheduler_rule and fails validation before any scheduler tick starts. The error propagates through ensure_bootstrap_rules and terminates daemon mode, whereas previously the invalid rule was isolated by the per-rule error handling; use a targeted field update or keep migration validation failures isolated.
Useful? React with 👍 / 👎.
Summary
Production evidence
The rc.7 daemon upgrade exposed an existing rc.3 legacy scan rule with safety_backup disabled and a scheduler run left running since May. This patch makes both repairs durable and automatic.
Verification