Repository navigation
feat(sync): abort a running sync from the profile card - #100
Conversation
While a Two-Way / One-Way run is live, the profile card's Pause button becomes Abort, so a sync can be stopped, its settings changed (Save and Reinstall refuse while a run is live) and restarted with Sync Now. - SyncAbort (pure core) finds the run from its lock holders plus their descendants, identifies roots by name, and never targets the app or launchd - graceful first: SIGINT to rclone only, so bisync saves its state; SIGTERM after 90 s or on Force Stop, SIGKILL 10 s later - locks cleaned stale-only, and only after every process has exited - an aborted run is not a failure: no error, notification or auto-fix, and the directory watcher does not restart it - an aborted initial sync defers its RunAtLoad agent load to the next Sync Now instead of restarting at once - ConfigSelfTest AC-AB1..AC-AB4, CLAUDE.md rule 9, README Co-authored-by: dash0-dev[bot] <257284812+dash0-dev[bot]@users.noreply.github.com>
Co-authored-by: dash0-dev[bot] <257284812+dash0-dev[bot]@users.noreply.github.com>
- identify run roots by identity: the script must carry this profile's config path, an rclone holder must be the app's own child - finish once no lock holder is live; release non-rclone orphans (the watchdog sleep) instead of waiting, keep escalating a leftover rclone - read the log to its end before the abort stops counting as in flight; a new run clears the trailing suppression - refuse new runs while an abort is in flight; the card treats it as running - Force Stop only escalates an in-flight abort (forceStopAbort) - view launchers report aborted from isAborting, not the time window - directory watcher leaves an aborted initial sync stopped Co-authored-by: dash0-dev[bot] <257284812+dash0-dev[bot]@users.noreply.github.com>
- an app-launched rclone root must also name this profile's local folder - never SIGINT the script's lsjson reachability probe - show Stopping... at once, but the phase (and Force Stop) only once something of the run is visible - refuse a script run while aborting before recording its trigger Co-authored-by: dash0-dev[bot] <257284812+dash0-dev[bot]@users.noreply.github.com>
✅ No issues foundAdds Abort / Force Stop for a live Two-Way or One-Way run: lock-holder identity, SIGINT then SIGTERM then SIGKILL, stale-only lock cleanup and run-end suppression. No blocking issues; one UX note on the timeout path. 1 advisory finding below the confidence bar — see Less certain below. Checked: 7 of 7 changed files read · 5 possible issues → 0 confirmed → 0 posted Less certain (1) — advisory, below the confidence bar
Review details
Found Quality — produced 5 → posted inline 0 · cleared 0 · carried forward 0 · deferred 0 · below-bar 1 Run full · 1086 lines in delta · tier deep · depth checkout Nothing to report — severity, reach diagram (impact graph found no consumer or importer), 0 files skipped.
|
|
Darkplane auto-approval is enabled for this repository (mode: Auto-approve). Trigger an evaluation for this pull request when it is ready: |
Summary
While a Two-Way / One-Way profile is syncing, its Pause button becomes Abort, so a sync can be stopped, its settings changed and restarted with Sync Now. Save and Reinstall refuse while a run is live (Rule 8), so until now a long initial sync left nothing to do but wait.
Changes
SyncAbort(pure core next toSyncRunLock): finds the run from its two lock holders plus their descendants (ps -A). A holder is only used once identified as this profile's run: the script by its<configPath>argument, or an app-launched rclone as the app's child syncing this profile's folder. A reused PID, a mount daemon, the app itself and launchd are never signalled.tee(rclone would SIGPIPE) or to thelsjsonprobe. After 90 s, or on Force Stop (behind a confirmation), every process of the run gets SIGTERM, and SIGKILL follows 10 s later.removeStaleLocks(stale-only). No new run can start while an abort is in flight.--resync. The directory watcher doesn't restart the sync because of the run's own final writes.RunAtLoadagent load waits for the next Sync Now (or a Save), so the sync doesn't restart the moment it was stopped.ConfigSelfTestAC-AB1…AC-AB4, plus CLAUDE.md rule 9 and README.Verification
SyncTray --self-testare the first real compile and test.--resync.Known limits