fix(router): read health states without a catch-all, DualCache already swallows read errors

This commit is contained in:
Yujong Lee 2026-11-06 16:09:24 +09:00
parent 6d019c9dc8
commit 5881fc4a0e

View file

@ -108,20 +108,12 @@ class DeploymentHealthCache:
@with_service_target(HEALTH_CHECKS_TARGET)
async def async_get_states(self) -> object:
"""Every deployment's raw state, as the router core's health filter reads it; a failed read is None."""
try:
return await self.cache.async_get_cache(key=self.CACHE_KEY) # pyright: ignore[reportUnknownMemberType, reportUnknownVariableType] # DualCache's reads are untyped
except Exception as e:
verbose_logger.debug("DeploymentHealthCache::async_get_states - Exception: %s", str(e))
return None
return await self.cache.async_get_cache(key=self.CACHE_KEY) # pyright: ignore[reportUnknownMemberType, reportUnknownVariableType] # DualCache's reads are untyped
@with_service_target(HEALTH_CHECKS_TARGET)
def get_states(self) -> object:
"""``async_get_states`` for a sync call."""
try:
return self.cache.get_cache(key=self.CACHE_KEY) # pyright: ignore[reportUnknownMemberType, reportUnknownVariableType] # DualCache's reads are untyped
except Exception as e:
verbose_logger.debug("DeploymentHealthCache::get_states - Exception: %s", str(e))
return None
return self.cache.get_cache(key=self.CACHE_KEY) # pyright: ignore[reportUnknownMemberType, reportUnknownVariableType] # DualCache's reads are untyped
@with_service_target(HEALTH_CHECKS_TARGET)
async def async_get_unhealthy_deployment_ids(self, parent_otel_span: Span | None = None) -> set[str]: