fix(core): improve service startup and cleanup reliability

Wait longer for slow Windows service startup, then hand off from sidecar
to service when it becomes ready. Retry service core startup during the
handoff window, and clean up root-owned macOS service core/IPC leftovers
before uninstalling the service.
This commit is contained in:
wonfen
2026-06-28 04:34:01 +08:00
parent 1e44bafa79
commit 1112f0730d
6 changed files with 224 additions and 7 deletions
+5
View File
@@ -42,6 +42,9 @@ pub struct CoreManager {
state: ArcSwap<State>,
last_update: ArcSwapOption<Instant>,
config_update_in_progress: AtomicBool,
// sidecar→service 交接 watcher 单实例标志。
#[cfg(target_os = "windows")]
handoff_watcher_running: AtomicBool,
}
#[derive(Debug)]
@@ -65,6 +68,8 @@ impl Default for CoreManager {
state: ArcSwap::new(Arc::new(State::default())),
last_update: ArcSwapOption::new(None),
config_update_in_progress: AtomicBool::new(false),
#[cfg(target_os = "windows")]
handoff_watcher_running: AtomicBool::new(false),
}
}
}