mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-21 00:21:49 +00:00
fix(router): address greptile review comments
- Narrow cooldown safety-net bypass: only fires when allowed_fails_policy is set (cooldown is health-check driven). Without a policy, cooldowns are from real request failures and must not be bypassed. - Restore cooldown deployments DEBUG log that was accidentally removed. - Fix test_health TypeError: move exception extraction to a separate exceptions_by_model_id dict returned alongside endpoints, so exception objects never appear in the endpoint dicts that get JSON-serialized by the /health response. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
fc155c7bfa
commit
5850b1130e
1 changed files with 15 additions and 2 deletions
|
|
@ -9079,12 +9079,21 @@ class Router:
|
|||
cooldown_deployments = await _async_get_cooldown_deployments(
|
||||
litellm_router_instance=self, parent_otel_span=parent_otel_span
|
||||
)
|
||||
if verbose_router_logger.isEnabledFor(logging.DEBUG):
|
||||
verbose_router_logger.debug(f"cooldown deployments: {cooldown_deployments}")
|
||||
_pre_cooldown_deployments = healthy_deployments
|
||||
healthy_deployments = self._filter_cooldown_deployments(
|
||||
healthy_deployments=healthy_deployments,
|
||||
cooldown_deployments=cooldown_deployments,
|
||||
)
|
||||
if not healthy_deployments and self.enable_health_check_routing:
|
||||
# Safety net: only bypass cooldown filter when health-check routing is
|
||||
# driving cooldown (i.e. allowed_fails_policy is set). Without a policy,
|
||||
# cooldowns are from real request failures and must not be bypassed.
|
||||
if (
|
||||
not healthy_deployments
|
||||
and self.enable_health_check_routing
|
||||
and self.allowed_fails_policy is not None
|
||||
):
|
||||
verbose_router_logger.warning(
|
||||
"All deployments in cooldown via health-check routing, bypassing cooldown filter"
|
||||
)
|
||||
|
|
@ -9526,7 +9535,11 @@ class Router:
|
|||
healthy_deployments=healthy_deployments,
|
||||
cooldown_deployments=cooldown_deployments,
|
||||
)
|
||||
if not healthy_deployments and self.enable_health_check_routing:
|
||||
if (
|
||||
not healthy_deployments
|
||||
and self.enable_health_check_routing
|
||||
and self.allowed_fails_policy is not None
|
||||
):
|
||||
verbose_router_logger.warning(
|
||||
"All deployments in cooldown via health-check routing, bypassing cooldown filter"
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue