Skip to content

Commit

Permalink
[serve] Fix flaky test_http_state (#39184)
Browse files Browse the repository at this point in the history
Ensure `state.update` is not called at terminal states.
  • Loading branch information
GeneDer committed Sep 6, 2023
1 parent d5fdce4 commit 74bce4a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions python/ray/serve/_private/http_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,8 @@ def update(self, draining: bool = False):
HEALTHY -> DRAINING or UNHEALTHY
DRAINING -> HEALTHY or UNHEALTHY or DRAINED
1) When the HTTP proxy is already shutting down, do nothing.
1) When the HTTP proxy is already shutting down, in DRAINED or UNHEALTHY status,
do nothing.
2) When the HTTP proxy is starting, check ready object reference. If ready
object reference returns a successful call set status to HEALTHY. If the
call to ready() on the HTTP Proxy actor has any exception or timeout, increment
Expand All @@ -212,7 +213,11 @@ def update(self, draining: bool = False):
5) Transition the status between HEALTHY and DRAINING.
6) When the HTTP proxy is draining, check whether it's drained or not.
"""
if self._shutting_down:
if (
self._shutting_down
or self._status == ProxyStatus.DRAINED
or self._status == ProxyStatus.UNHEALTHY
):
return

if self._status == ProxyStatus.STARTING:
Expand Down

0 comments on commit 74bce4a

Please sign in to comment.