Skip to content

Commit

Permalink
[Serve] make client poll more frequently (#22666)
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-mo authored Feb 25, 2022
1 parent 0da541b commit 4bf587f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions python/ray/serve/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@
"[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}"
)

# The polling interval for serve client to wait to deployment state
_CLIENT_POLLING_INTERVAL_S: float = 1


def _get_controller_namespace(detached):
controller_namespace = ray.get_runtime_context().namespace
Expand Down Expand Up @@ -214,7 +217,7 @@ def _wait_for_deployments_shutdown(self, timeout_s: int = 60):
logger.debug(
f"Waiting for shutdown, {len(statuses)} deployments still alive."
)
time.sleep(1)
time.sleep(_CLIENT_POLLING_INTERVAL_S)
else:
live_names = list(statuses.keys())
raise TimeoutError(
Expand Down Expand Up @@ -252,7 +255,7 @@ def _wait_for_deployment_healthy(self, name: str, timeout_s: int = -1):
logger.debug(
f"Waiting for {name} to be healthy, current status: {status.status}."
)
time.sleep(1)
time.sleep(_CLIENT_POLLING_INTERVAL_S)
else:
raise TimeoutError(
f"Deployment {name} did not become HEALTHY after {timeout_s}s."
Expand All @@ -273,7 +276,7 @@ def _wait_for_deployment_deleted(self, name: str, timeout_s: int = 60):
logger.debug(
f"Waiting for {name} to be deleted, current status: {curr_status}."
)
time.sleep(1)
time.sleep(_CLIENT_POLLING_INTERVAL_S)
else:
raise TimeoutError(f"Deployment {name} wasn't deleted after {timeout_s}s.")

Expand Down

0 comments on commit 4bf587f

Please sign in to comment.