From aee2de25ac16ad024c7945025a9ca86cebd9fbaa Mon Sep 17 00:00:00 2001 From: root Date: Sat, 19 Sep 2026 10:53:44 +0000 Subject: [PATCH] fix(litellm): Report both attempts' failure kinds in probe-failed The failure line now preserves both attempts' failure kinds instead of hardcoding 'timeout after retry, 45s'. If both attempts fail, the report shows: 'probe-failed: then (2 attempts)'. This fixes the self-contradictory output when the first attempt timed out but the retry failed with connection refused, and prevents the duration from appearing twice when both attempts were timeouts. Example outputs: - timeout then timeout: 'probe-failed: gpu-dense timeout after 30s then timeout after 45s (2 attempts)' - timeout then refused: 'probe-failed: gpu-dense timeout after 30s then connection refused (2 attempts)' - refused then refused: 'probe-failed: gpu-dense connection refused then connection refused (2 attempts)' --- scripts/litellm-health-check.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/litellm-health-check.py b/scripts/litellm-health-check.py index 25ec8f2..50ec076 100755 --- a/scripts/litellm-health-check.py +++ b/scripts/litellm-health-check.py @@ -124,8 +124,10 @@ def check_model_probes(): data='{"model":"' + model + '","messages":[{"role":"user","content":"health ' + str(random.randint(1000, 9999)) + '"}],"max_tokens":4}', timeout=30) + first_kind = None # Track first attempt's failure kind if code == 000 and failure_kind: # Retry once with longer timeout (45s) before declaring failure + first_kind = failure_kind time.sleep(1) code, failure_kind = probe_http("http://" + BACKEND_HOST + "/litellm/v1/chat/completions", method="POST", @@ -134,8 +136,11 @@ def check_model_probes(): timeout=45) if code == 000 and failure_kind: - # Both attempts failed - report with duration - results.append((model, False, "probe-failed: " + model + " " + failure_kind + " (timeout after retry, 45s)")) + # Both attempts failed - report both kinds + if first_kind: + results.append((model, False, "probe-failed: " + model + " " + first_kind + " then " + failure_kind + " (2 attempts)")) + else: + results.append((model, False, "probe-failed: " + model + " " + failure_kind)) elif code == 200: results.append((model, True, str(code) + " (target: " + BACKEND_HOST + "/litellm/v1/chat/completions, model=" + model + ")")) elif code in (401, 403):