fix(docker): a crash-looping service belongs in Needs attention (#5209)
failing_services filtered on `(service_trouble(s) or 9) <= 2`; a crash loop ranks 0, which is falsy, so the worst kind of trouble was left out. Test the rank against None. The page test's task error also gains the age_s the _swarm_failures include reads. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -377,4 +377,6 @@ def failing_services(services: list[dict]) -> list[dict]:
|
||||
"""The services that belong in Needs attention: a crash loop, or short of
|
||||
their desired replicas. A healthy service whose failed tasks Swarm has
|
||||
already replaced is history, shown on the service, not a problem now."""
|
||||
return [s for s in services_problems_first(services) if (service_trouble(s) or 9) <= 2]
|
||||
# A crash loop ranks 0, so test the rank against None, not for truth.
|
||||
return [s for s in services_problems_first(services)
|
||||
if (t := service_trouble(s)) is not None and t <= 2]
|
||||
|
||||
Reference in New Issue
Block a user