From fae358dc092df2fa3d514be009d3a72aa8745d92 Mon Sep 17 00:00:00 2001 From: Intern Dev Date: Mon, 13 Apr 2026 00:48:59 -0400 Subject: [PATCH] fix(nim): bound curl health probes with --max-time The NIM health probe loop and nimStatusByName() use `curl -sf` without a timeout. On a hung or silently-dropping NIM endpoint the curl call can block indefinitely, stalling onboard/waitForNimHealth and CLI status. Add `--max-time 5` to both probe calls so each attempt times out cleanly and the outer retry loop can make progress. --- src/lib/nim.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/lib/nim.ts b/src/lib/nim.ts index d0118ff393a..5e6b9d9200d 100644 --- a/src/lib/nim.ts +++ b/src/lib/nim.ts @@ -209,9 +209,10 @@ export function waitForNimHealth(port = 8000, timeout = 300): boolean { while ((Date.now() - start) / 1000 < timeout) { try { - const result = runCapture(`curl -sf http://localhost:${hostPort}/v1/models`, { - ignoreError: true, - }); + const result = runCapture( + `curl -sf --max-time 5 http://localhost:${hostPort}/v1/models`, + { ignoreError: true }, + ); if (result) { console.log(" NIM is healthy."); return true; @@ -263,7 +264,7 @@ export function nimStatusByName(name: string, port?: number): NimStatus { resolvedHostPort = m ? Number(m[1]) : 8000; } const health = runCapture( - `curl -sf http://localhost:${resolvedHostPort}/v1/models 2>/dev/null`, + `curl -sf --max-time 5 http://localhost:${resolvedHostPort}/v1/models 2>/dev/null`, { ignoreError: true }, ); healthy = !!health;