From b3cff3651e107c162f39bd50077291818079a9b5 Mon Sep 17 00:00:00 2001 From: finetune <82650881+finetunej@users.noreply.github.com> Date: Sun, 29 Jun 2025 23:41:34 +0200 Subject: [PATCH] Fix sgl-router startup crash (#7619) --- sgl-router/src/router.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sgl-router/src/router.rs b/sgl-router/src/router.rs index 3b45ecde7..136ed9b12 100644 --- a/sgl-router/src/router.rs +++ b/sgl-router/src/router.rs @@ -180,7 +180,15 @@ impl Router { } _ => { // Wait until all workers are healthy for regular modes - Self::wait_for_healthy_workers(&worker_urls, timeout_secs, interval_secs)?; + let worker_urls = worker_urls.clone(); + std::thread::spawn(move || { + Self::wait_for_healthy_workers(&worker_urls, timeout_secs, interval_secs) + }) + .join() + .map_err(|e| { + error!("Health-check thread panicked: {:?}", e); + format!("Health-check thread panicked: {e:?}") + })??; } }