docstr: Completely shut down the connected Serve instance.
  
  Shuts down all processes and deletes all state associated with the
  instance.
docstr_tok: ["Completely","shut","down","the","connected","Serve","instance",".","Shuts","down","all","processes","and","deletes","all","state","associated","with","the","instance","."]
code: def shutdown(self, timeout_s: float = 30.0) -> None:
      """Completely shut down the connected Serve instance.
  
      Shuts down all processes and deletes all state associated with the
      instance.
      """
      self.shutdown_cached_handles()
  
      if ray.is_initialized() and not self._shutdown:
          try:
              ray.get(
                  self._controller.graceful_shutdown.remote(),
                  timeout=timeout_s,
              )
          except ray.exceptions.RayActorError:
              # Controller has been shut down.
              pass
          except TimeoutError:
              logger.warning(
                  f"Controller failed to shut down within {timeout_s}s. "
                  "Check controller logs for more details."
              )
          self._shutdown = True
  
imports: import logging
  import random
  import time
  from functools import wraps
  from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple, Union
  import ray
  from ray.actor import ActorHandle
  from ray.serve._private.common import ApplicationStatus, DeploymentID, DeploymentStatus, DeploymentStatusInfo, MultiplexedReplicaInfo, StatusOverview
  from ray.serve._private.config import DeploymentConfig, ReplicaConfig
  from ray.serve._private.constants import CLIENT_CHECK_CREATION_POLLING_INTERVAL_S, CLIENT_POLLING_INTERVAL_S, MAX_CACHED_HANDLES, RAY_SERVE_ENABLE_NEW_HANDLE_API, SERVE_DEFAULT_APP_NAME
  from ray.serve._private.controller import ServeController
  from ray.serve._private.deploy_utils import get_deploy_args
  from ray.serve._private.deployment_info import DeploymentInfo
  from ray.serve.config import HTTPOptions
  from ray.serve.exceptions import RayServeException
  from ray.serve.generated.serve_pb2 import DeploymentArgs, DeploymentRoute, DeploymentRouteList
  from ray.serve.generated.serve_pb2 import DeploymentStatusInfo
  from ray.serve.generated.serve_pb2 import StatusOverview
  from ray.serve.handle import DeploymentHandle, RayServeHandle, RayServeSyncHandle
  from ray.serve.schema import LoggingConfig, ServeApplicationSchema, ServeDeploySchema
label_desc: Use image node_id 6 for calling the ServeControllerClient obj's underlying member method code with example usage: obj.shutdown(timeout_s) without return types