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.
This commit is contained in:
2026-03-20 10:03:47 -07:00
committed by Naomi Carrigan
parent 3c892b95cf
commit 457cca55eb
+4 -3
View File
@@ -603,12 +603,13 @@ impl WslBridge {
); );
// Watchdog: if system:init never arrives the process is truly hung (e.g. a silent crash // 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. // after spawning). After 30 seconds we kill it so the user is not stuck forever.
// handle_stdout will surface the error when stdout closes after the kill. // 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 process_watchdog = self.process.clone();
let received_init_watchdog = self.received_init.clone(); let received_init_watchdog = self.received_init.clone();
thread::spawn(move || { thread::spawn(move || {
thread::sleep(Duration::from_secs(60)); thread::sleep(Duration::from_secs(30));
if !received_init_watchdog.load(Ordering::SeqCst) { if !received_init_watchdog.load(Ordering::SeqCst) {
if let Some(mut proc) = process_watchdog.lock().take() { if let Some(mut proc) = process_watchdog.lock().take() {
let _ = proc.kill(); let _ = proc.kill();