Skip to content

The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.

docs(sidecar): Kommentare in health.rs und process_util.rs auf die neue Lage gebracht

purple89a4d8a9b85e
diff --git a/src-tauri/src/commands/health.rs b/src-tauri/src/commands/health.rs
index 926905bd..4ea8dbf2 100644
--- a/src-tauri/src/commands/health.rs
+++ b/src-tauri/src/commands/health.rs
@@ -429,10 +429,17 @@ pub async fn system_health(
let comfy_url = comfy_probe_url(&state);
let lm_studio_url = lm_studio_probe_url(lm_studio_base.as_deref());
- // Probe all three backends concurrently, each bounded by
- // PROBE_TIMEOUT, so worst case is ~PROBE_TIMEOUT total instead of 3x
- // serial. Async client (see probe_http note); never reqwest::blocking
- // here.
+ // Probe all three backends concurrently, each bounded by PROBE_TIMEOUT,
+ // instead of 3x serial. review-winfix.md A1: this is no longer
+ // "~PROBE_TIMEOUT total" for every target. connect_window_for resolves
+ // the hostname BEFORE building the client, i.e. before PROBE_TIMEOUT
+ // starts counting, and that resolution carries no timeout of its own; a
+ // configured hostname whose DNS server is unreachable hangs for however
+ // long the OS resolver takes (several seconds, possibly more on
+ // Windows) before the 1.5s window even begins. Only a target that needs
+ // no resolution (an IP literal, or a name already sitting on loopback)
+ // still bounds at ~PROBE_TIMEOUT. Async client (see probe_http note);
+ // never reqwest::blocking here.
let (ollama, comfyui, lm_studio) = tokio::join!(
probe_http(&ollama_url, PROBE_TIMEOUT),
probe_http(&comfy_url, PROBE_TIMEOUT),
diff --git a/src-tauri/src/process_util.rs b/src-tauri/src/process_util.rs
index 8f2108f5..adbd87bd 100644
--- a/src-tauri/src/process_util.rs
+++ b/src-tauri/src/process_util.rs
@@ -692,11 +692,20 @@ const KILL_GRACE: std::time::Duration = std::time::Duration::from_millis(800);
/// callers hand over an unreaped `Child` and drop it afterwards without
/// waiting, which is exactly right.
///
-/// Nothing here blocks the caller: `video_cancel` holds the `video_process`
-/// mutex across this call and the UI polls that same mutex, so the old
-/// 800 ms sleep froze the window for the whole grace. The tunnel path has the
-/// same shape on quit. The grace, the escalation and the final reap run on a
-/// detached thread instead.
+/// On Unix, nothing here blocks the caller: `video_cancel` holds the
+/// `video_process` mutex across this call and the UI polls that same mutex,
+/// so the old 800 ms sleep froze the window for the whole grace. The tunnel
+/// path has the same shape on quit. The grace, the escalation and the final
+/// reap run on a detached thread instead.
+///
+/// review-winfix.md A2: on Windows the caller now waits. The `#[cfg(windows)]`
+/// branch below calls `commands::shell::kill_tree` (its own doc comment has
+/// the measurement and the reason) synchronously, no detached thread; the
+/// bauer measured 120 to 248 ms for the ordinary case, and up to
+/// `shell::TREE_KILL_SETTLE` (1.5 s) in the worst one. For `video_cancel` that
+/// wait sits UNDER the held `video_process` mutex the UI polls, so a Windows
+/// cancel can freeze that window for the same span the old 800 ms sleep did;
+/// `shutdown_tunnel` pays the same cost on the program's quit path instead.
pub fn kill_tree(child: &mut Child) -> std::io::Result<()> {
let pid = child.id();
#[cfg(windows)]