From 457cca55eb810fa9170827ca2912e229ac1b444d Mon Sep 17 00:00:00 2001 From: Hikari Date: Fri, 20 Mar 2026 10:03:47 -0700 Subject: [PATCH] fix: tighten startup watchdog and correct misleading comment (#227) Reduces the startup watchdog from 60 s to 30 s and corrects the comment that incorrectly stated "5 minutes". CLI v2.1.79 fixed the subprocess stdin hang that originally necessitated the longer timeout. --- src-tauri/src/wsl_bridge.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src-tauri/src/wsl_bridge.rs b/src-tauri/src/wsl_bridge.rs index d8cf153..29bf73e 100644 --- a/src-tauri/src/wsl_bridge.rs +++ b/src-tauri/src/wsl_bridge.rs @@ -603,12 +603,13 @@ impl WslBridge { ); // Watchdog: if system:init never arrives the process is truly hung (e.g. a silent crash - // after spawning). After 5 minutes we kill it so the user isn't stuck forever. - // handle_stdout will surface the error when stdout closes after the kill. + // after spawning). After 30 seconds we kill it so the user is not stuck forever. + // The CLI v2.1.79 stdin-hang fix means startup is reliably fast; 30 s is a generous + // safety net rather than a workaround for a known hang. let process_watchdog = self.process.clone(); let received_init_watchdog = self.received_init.clone(); thread::spawn(move || { - thread::sleep(Duration::from_secs(60)); + thread::sleep(Duration::from_secs(30)); if !received_init_watchdog.load(Ordering::SeqCst) { if let Some(mut proc) = process_watchdog.lock().take() { let _ = proc.kill();