python/ray/util/client/dataclient.py
def _reconnect_channel(self) -> None:
        """
        Attempts to reconnect the gRPC channel and resend outstanding
        requests. First, the server is pinged to see if the current channel
        still works. If the ping fails, then the current channel is closed
        and replaced with a new one.

        Once a working channel is available, a new request queue is made
        and filled with any outstanding requests to be resent to the server.
        """
        try:
            # Ping the server to see if the current channel is reuseable, for
            # example if gRPC reconnected the channel on its own or if the
            # RPC error was transient and the channel is still open
            ping_succeeded = self.client_worker.ping_server(timeout=5)
        except grpc.RpcError:
            ping_succeeded = False

        if not ping_succeeded:
            # Ping failed, try refreshing the data channel
            logger.warning(
                "Encountered connection issues in the data channel. "
                "Attempting to reconnect."
            )
            try:
                self.client_worker._connect_channel(reconnecting=True)
            except ConnectionError:
                logger.warning("Failed to reconnect the data channel")
                raise
            logger.debug("Reconnection succeeded!")

        # Recreate the request queue, and resend outstanding requests
        with self.lock:
            self.request_queue = self._create_queue()
            for request in self.outstanding_requests.values():
                # Resend outstanding requests
                self.request_queue.put(request)

        Attempts to reconnect the gRPC channel and resend outstanding
        requests. First, the server is pinged to see if the current channel
        still works. If the ping fails, then the current channel is closed
        and replaced with a new one.

        Once a working channel is available, a new request queue is made
        and filled with any outstanding requests to be resent to the server.
        
Attempts to reconnect the gRPC channel and resend outstanding
requests. First, the server is pinged to see if the current channel
still works. If the ping fails, then the current channel is closed
and replaced with a new one.

Once a working channel is available, a new request queue is made
and filled with any outstanding requests to be resent to the server.
Attempts to reconnect the gRPC channel and resend outstanding requests . First the server is pinged to see if the current channel still works . If the ping fails then the current channel is closed and replaced with a new one . Once a working channel is available a new request queue is made and filled with any outstanding requests to be resent to the server .
def _reconnect_channel(self) -> None:
        try:
            ping_succeeded = self.client_worker.ping_server(timeout=5)
        except grpc.RpcError:
            ping_succeeded = False
        if not ping_succeeded:
            logger.warning(
                "Encountered connection issues in the data channel. "
                "Attempting to reconnect."
            )
            try:
                self.client_worker._connect_channel(reconnecting=True)
            except ConnectionError:
                logger.warning("Failed to reconnect the data channel")
                raise
            logger.debug("Reconnection succeeded!")
        with self.lock:
            self.request_queue = self._create_queue()
            for request in self.outstanding_requests.values():
                self.request_queue.put(request)
def _reconnect_channel ( self ) -> None : try : ping_succeeded = self . client_worker . ping_server ( timeout = 5 ) except grpc . RpcError : ping_succeeded = False if not ping_succeeded : logger . warning ( "Encountered connection issues in the data channel. " "Attempting to reconnect." ) try : self . client_worker . _connect_channel ( reconnecting = True ) except ConnectionError : logger . warning ( "Failed to reconnect the data channel" ) raise logger . debug ( "Reconnection succeeded!" ) with self . lock : self . request_queue = self . _create_queue ( ) for request in self . outstanding_requests . values ( ) : self . request_queue . put ( request )
Attempts to reconnect the gRPC channel and resend outstanding
requests.
Attempts to reconnect the gRPC channel and resend outstanding requests .
"""
        Attempts to reconnect the gRPC channel and resend outstanding
        requests. First, the server is pinged to see if the current channel
        still works. If the ping fails, then the current channel is closed
        and replaced with a new one.

        Once a working channel is available, a new request queue is made
        and filled with any outstanding requests to be resent to the server.
        """ # Ping the server to see if the current channel is reuseable, for # example if gRPC reconnected the channel on its own or if the # RPC error was transient and the channel is still open # Ping failed, try refreshing the data channel # Recreate the request queue, and resend outstanding requests # Resend outstanding requests
self