fix(nim): bound curl health probes with --max-time - #1813
Conversation
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.
|
This repository limits contributors to 10 open pull requests. Please close or merge existing PRs before opening new ones. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdded a Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes Poem
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
## Summary The NIM health probe loop and \`nimStatusByName()\` use \`curl -sf\` without any timeout in \`src/lib/nim.ts\`. On a hung or silently-dropping NIM endpoint, the curl call can block indefinitely, stalling \`onboard\`/\`waitForNimHealth\` and CLI \`status\`. Add \`--connect-timeout 5 --max-time 5\` to both probe calls so each attempt fails fast on unresponsive endpoints and the outer retry loop can make progress. ## Changes - \`src/lib/nim.ts:212\` — \`waitForNimHealth\` loop probe - \`src/lib/nim.ts:265\` — \`nimStatusByName\` health probe ## Test plan - [x] Minimal diff, existing retry/interval behavior preserved - [x] 5s timeout chosen to fit under the 5s inter-retry sleep interval - [x] No new dependencies (Resubmitting — prior PR #1813 was auto-closed by the 10-PR-cap check when our open PR count briefly exceeded the limit; we're now under the cap.) 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Health readiness probes now enforce 5-second connection and overall timeouts for local HTTP checks, preventing probes from hanging indefinitely. This yields faster failure detection, quicker recovery, and reduced resource waits during startup and health checks. * **Tests** * Added and updated tests to verify health probes include the expected timeout behavior so regressions are caught early. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Signed-off-by: Intern Dev <dev@wukongai.io> Signed-off-by: Intern Dev <dev@wukongai.io> Co-authored-by: Intern Dev <dev@wukongai.io> Co-authored-by: Carlos Villela <cvillela@nvidia.com>
Summary
The NIM health probe loop and
nimStatusByName()usecurl -sfwithout a timeout insrc/lib/nim.ts. On a hung or silently-dropping NIM endpoint, the curl call can block indefinitely, stallingonboard/waitForNimHealthand CLIstatus.Add
--max-time 5to both probe calls so each attempt times out cleanly and the outer retry loop can make progress.Changes
src/lib/nim.ts:212—waitForNimHealthloop probe nowcurl -sf --max-time 5 ...src/lib/nim.ts:265—nimStatusByNamehealth probe nowcurl -sf --max-time 5 ...Test plan
sleepinterval inwaitForNimHealth🤖 Generated with Claude Code
Summary by CodeRabbit