python/ray/serve/client.py
def _wait_for_deployment_healthy(self, name: str, timeout_s: int = -1):
        """Waits for the named deployment to enter "HEALTHY" status.

        Raises RuntimeError if the deployment enters the "UNHEALTHY" status
        instead.

        Raises TimeoutError if this doesn't happen before timeout_s.
        """
        start = time.time()
        while time.time() - start < timeout_s or timeout_s < 0:
            statuses = self.get_deployment_statuses()
            try:
                status = statuses[name]
            except KeyError:
                raise RuntimeError(
                    f"Waiting for deployment {name} to be HEALTHY, "
                    "but deployment doesn't exist."
                ) from None

            if status.status == DeploymentStatus.HEALTHY:
                break
            elif status.status == DeploymentStatus.UNHEALTHY:
                raise RuntimeError(f"Deployment {name} is UNHEALTHY: {status.message}")
            else:
                # Guard against new unhandled statuses being added.
                assert status.status == DeploymentStatus.UPDATING

            logger.debug(
                f"Waiting for {name} to be healthy, current status: {status.status}."
            )
            time.sleep(CLIENT_POLLING_INTERVAL_S)
        else:
            raise TimeoutError(
                f"Deployment {name} did not become HEALTHY after {timeout_s}s."
            )
Waits for the named deployment to enter "HEALTHY" status.

        Raises RuntimeError if the deployment enters the "UNHEALTHY" status
        instead.

        Raises TimeoutError if this doesn't happen before timeout_s.
        
Waits for the named deployment to enter "HEALTHY" status.
Raises RuntimeError if the deployment enters the "UNHEALTHY" status
instead.

Raises TimeoutError if this doesn't happen before timeout_s.
Waits for the named deployment to enter " HEALTHY " status . Raises RuntimeError if the deployment enters the " UNHEALTHY " status instead . Raises TimeoutError if this doesn ' t happen before timeout_s .
def _wait_for_deployment_healthy(self, name: str, timeout_s: int = -1):
        start = time.time()
        while time.time() - start < timeout_s or timeout_s < 0:
            statuses = self.get_deployment_statuses()
            try:
                status = statuses[name]
            except KeyError:
                raise RuntimeError(
                    f"Waiting for deployment {name} to be HEALTHY, "
                    "but deployment doesn't exist."
                ) from None
            if status.status == DeploymentStatus.HEALTHY:
                break
            elif status.status == DeploymentStatus.UNHEALTHY:
                raise RuntimeError(f"Deployment {name} is UNHEALTHY: {status.message}")
            else:
                assert status.status == DeploymentStatus.UPDATING
            logger.debug(
                f"Waiting for {name} to be healthy, current status: {status.status}."
            )
            time.sleep(CLIENT_POLLING_INTERVAL_S)
        else:
            raise TimeoutError(
                f"Deployment {name} did not become HEALTHY after {timeout_s}s."
            )
def _wait_for_deployment_healthy ( self , name : str , timeout_s : int = - 1 ) : start = time . time ( ) while time . time ( ) - start < timeout_s or timeout_s < 0 : statuses = self . get_deployment_statuses ( ) try : status = statuses [ name ] except KeyError : raise RuntimeError ( f"Waiting for deployment {name} to be HEALTHY, " "but deployment doesn't exist." ) from None if status . status == DeploymentStatus . HEALTHY : break elif status . status == DeploymentStatus . UNHEALTHY : raise RuntimeError ( f"Deployment {name} is UNHEALTHY: {status.message}" ) else : assert status . status == DeploymentStatus . UPDATING logger . debug ( f"Waiting for {name} to be healthy, current status: {status.status}." ) time . sleep ( CLIENT_POLLING_INTERVAL_S ) else : raise TimeoutError ( f"Deployment {name} did not become HEALTHY after {timeout_s}s." )
Waits for the named deployment to enter "HEALTHY" status.
Waits for the named deployment to enter " HEALTHY " status .
"""Waits for the named deployment to enter "HEALTHY" status.

        Raises RuntimeError if the deployment enters the "UNHEALTHY" status
        instead.

        Raises TimeoutError if this doesn't happen before timeout_s.
        """ # Guard against new unhandled statuses being added.
self
name
str
timeout_s
int