mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-20 00:11:50 +00:00
revert: undo allowed_fails_policy gate on cooldown loop
Cooldown integration via health checks is intentional for all enable_health_check_routing users, not just those with allowed_fails_policy. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
aa17af2a37
commit
d0b04a7d52
1 changed files with 24 additions and 29 deletions
|
|
@ -2163,40 +2163,35 @@ def _write_health_state_to_router_cache(
|
|||
sum(1 for s in states.values() if not s.get("is_healthy")),
|
||||
)
|
||||
|
||||
# Only feed health check failures into the cooldown pipeline when
|
||||
# allowed_fails_policy is configured. Without it, cooldown is not the
|
||||
# routing exclusion mechanism and triggering it would be a
|
||||
# backwards-incompatible behavioral change for existing users.
|
||||
if llm_router.allowed_fails_policy is not None:
|
||||
for endpoint in unhealthy_endpoints:
|
||||
model_id = endpoint.get("model_id")
|
||||
if not model_id:
|
||||
continue
|
||||
for endpoint in unhealthy_endpoints:
|
||||
model_id = endpoint.get("model_id")
|
||||
if not model_id:
|
||||
continue
|
||||
|
||||
original_exception = _exceptions.get(model_id)
|
||||
if original_exception is None:
|
||||
continue
|
||||
original_exception = _exceptions.get(model_id)
|
||||
if original_exception is None:
|
||||
continue
|
||||
|
||||
exception_status = getattr(original_exception, "status_code", 500)
|
||||
exception_status = getattr(original_exception, "status_code", 500)
|
||||
|
||||
if llm_router.health_check_ignore_transient_errors and exception_status in (
|
||||
429,
|
||||
408,
|
||||
):
|
||||
continue
|
||||
if llm_router.health_check_ignore_transient_errors and exception_status in (
|
||||
429,
|
||||
408,
|
||||
):
|
||||
continue
|
||||
|
||||
increment_deployment_failures_for_current_minute(
|
||||
litellm_router_instance=llm_router,
|
||||
deployment_id=model_id,
|
||||
)
|
||||
increment_deployment_failures_for_current_minute(
|
||||
litellm_router_instance=llm_router,
|
||||
deployment_id=model_id,
|
||||
)
|
||||
|
||||
_set_cooldown_deployments(
|
||||
litellm_router_instance=llm_router,
|
||||
original_exception=original_exception,
|
||||
exception_status=exception_status,
|
||||
deployment=model_id,
|
||||
time_to_cooldown=llm_router.cooldown_time,
|
||||
)
|
||||
_set_cooldown_deployments(
|
||||
litellm_router_instance=llm_router,
|
||||
original_exception=original_exception,
|
||||
exception_status=exception_status,
|
||||
deployment=model_id,
|
||||
time_to_cooldown=llm_router.cooldown_time,
|
||||
)
|
||||
|
||||
except Exception as e:
|
||||
verbose_proxy_logger.warning(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue