Skip to content

scheduler: boot pid check, batch ops, verifier restore - #20

Open
ash-iir wants to merge 3 commits into
VD171:mainfrom
ash-iir:up-scheduler
Open

ash-iir wants to merge 3 commits into
VD171:mainfrom
ash-iir:up-scheduler

Conversation

@ash-iir

@ash-iir ash-iir commented Nov 19, 2026

Copy link
Copy Markdown

What

Scheduler and batch fixes: a stale scheduler pid from before a reboot is no longer trusted, each scheduled job runs as one batch op and prunes only after it succeeds, and the install verifier setting is put back after a batch restore.

One commit per fix, so any of them can be dropped on its own. Each line links the draft PR on my fork that has the full write-up and repro for that fix.

  • service: don't trust a stale scheduler pid after reboot (details)
  • worker: put the install verifier back after a batch restore (details)
  • scheduler: run each job as one batch op and prune after success (details)

Checklist

  • The project banner header is present on every new/changed source file. (no new files)
  • Code and comments are in English; no em/en-dashes.
  • If a UI label changed, all lang/<code>.json and README.<code>.md were updated. (no UI label changes)
  • No real feature (SELinux/uid-gid/modes preservation, etc.) was weakened.
  • Commits are signed off (git commit -s).
  • Tested on a rooted device/emulator (note which). Not tested on a rooted device or emulator. Checked with sh -n, mksh -n, busybox sh -n and shellcheck -s sh (no new warnings), small mksh/busybox repro scripts per fix, and the tools/screenshots Playwright mocks (en and ar) for WebUI changes.

Notes

Merge with or after the restore-safety PR is fine; they touch different functions.

The five grouped PRs (restore safety, scheduler, destinations, WebUI fixes, performance) merge cleanly together in any order; I checked that combining all of them gives the same tree as my test build.

The pid file survives reboot. When its pid was reused by another process,
kill -0 succeeded and the scheduler loop never started for that boot.
Match the loop's own command line, which carries the pid file path.

Signed-off-by: ash-iir <254348575+ash-iir@users.noreply.github.com>
(cherry picked from commit 619fbf6)
Each batch item runs restore() in a subshell, which runs no EXIT trap,
so verifier_restore never ran and the next item saved 0 as the old value.
verifier_verify_adb_installs and package_verifier_enable stayed off.
Turn the verifier off once in restore_batch and restore it there.

Signed-off-by: ash-iir <254348575+ash-iir@users.noreply.github.com>
(cherry picked from commit cb1454e)
scheduler-tick and the auto-backup observer started one detached worker
per package, all at once, and pruned right after starting them. A job
for all apps therefore ran every backup in parallel, and pruning counted
the backups still being written, so a failed run could leave one good
backup fewer than keep.

- Each due job now starts one backup-batch (or restore-batch) op for
  its targets; the auto-backup observer starts one backup-batch.
- Scheduled and auto batches carry keep; backup_batch prunes an app to
  keep finished backups only after that app's backup succeeded.
- prune_pkg counts and removes only backups with a manifest.json.
- scheduler-tick no longer reports pruned refs (pruning happens later,
  in the worker, and is still audited).

Signed-off-by: ash-iir <254348575+ash-iir@users.noreply.github.com>
(cherry picked from commit c5a219e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant