Skip to content

Commit 995253a

Browse files
authored
fix(BA-3938): Remove PROVISIONING from Endpoint resolved status and consolidate to DEGRADED (#8115)
1 parent f1a00ab commit 995253a

File tree

3 files changed

+24
-12
lines changed

3 files changed

+24
-12
lines changed

changes/8115.fix.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Remove `PROVISIONING` from `Endpoint` resolved status and consolidate to `DEGRADED`

src/ai/backend/manager/api/gql_legacy/endpoint.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -923,18 +923,7 @@ async def resolve_status(self, info: graphene.ResolveInfo) -> str:
923923
return EndpointStatus.HEALTHY
924924
if healthy_service_count == 0:
925925
return EndpointStatus.UNHEALTHY
926-
problematic_service_count = len([
927-
r
928-
for r in self.routings
929-
if r.status
930-
in (
931-
RouteStatus.UNHEALTHY.name,
932-
RouteStatus.DEGRADED.name,
933-
)
934-
])
935-
if problematic_service_count > 0:
936-
return EndpointStatus.DEGRADED
937-
return EndpointStatus.PROVISIONING
926+
return EndpointStatus.DEGRADED
938927

939928
async def resolve_model_vfolder(self, info: graphene.ResolveInfo) -> VirtualFolderNode:
940929
if not self.model:

tests/unit/manager/api/endpoint/test_types.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,25 @@ async def test_status_degraded_when_healthy_and_degraded_routes_mixed(self) -> N
4545

4646
result = await Endpoint.resolve_status(mock_endpoint, info=Mock())
4747
assert result == EndpointStatus.DEGRADED
48+
49+
async def test_status_degraded_when_healthy_and_provisioning_routes_mixed(self) -> None:
50+
"""
51+
When some routes are healthy and others are still provisioning,
52+
the endpoint status should be DEGRADED (not PROVISIONING).
53+
54+
Previously returned PROVISIONING, but this was changed to DEGRADED
55+
for clearer status semantics.
56+
"""
57+
mock_endpoint = Mock(spec=Endpoint)
58+
mock_endpoint.lifecycle_stage = EndpointLifecycle.READY.name
59+
mock_endpoint.retries = 0
60+
61+
healthy_route = Mock()
62+
healthy_route.status = RouteStatus.HEALTHY.name
63+
provisioning_route = Mock()
64+
provisioning_route.status = RouteStatus.PROVISIONING.name
65+
66+
mock_endpoint.routings = [healthy_route, provisioning_route]
67+
68+
result = await Endpoint.resolve_status(mock_endpoint, info=Mock())
69+
assert result == EndpointStatus.DEGRADED

0 commit comments

Comments
 (0)