src/Connection/Aggregate/RedisCluster.php
private function retryCommandOnFailure(CommandInterface $command, $method)
    {
        $failure = false;

        RETRY_COMMAND: {
            try {
                $response = $this->getConnection($command)->$method($command);
            } catch (ConnectionException $exception) {
                $connection = $exception->getConnection();
                $connection->disconnect();

                $this->remove($connection);

                if ($failure) {
                    throw $exception;
                } elseif ($this->useClusterSlots) {
                    $this->askSlotsMap();
                }

                $failure = true;

                goto RETRY_COMMAND;
            }
        }

        return $response;
    }
private function retryCommandOnFailure(CommandInterface $command, $method)
    {
        $failure = false;

        RETRY_COMMAND: {
            try {
                $response = $this->getConnection($command)->$method($command);
            } catch (ConnectionException $exception) {
                $connection = $exception->getConnection();
                $connection->disconnect();

                $this->remove($connection);

                if ($failure) {
                    throw $exception;
                } elseif ($this->useClusterSlots) {
                    $this->askSlotsMap();
                }

                $failure = true;

                goto RETRY_COMMAND;
            }
        }

        return $response;
    }
private function retryCommandOnFailure ( CommandInterface $ command , $ method ) { $ failure = false ; RETRY_COMMAND : { try { $ response = $ this -> getConnection ( $ command ) -> $ method ( $ command ) ; } catch ( ConnectionException $ exception ) { $ connection = $ exception -> getConnection ( ) ; $ connection -> disconnect ( ) ; $ this -> remove ( $ connection ) ; if ( $ failure ) { throw $ exception ; } elseif ( $ this -> useClusterSlots ) { $ this -> askSlotsMap ( ) ; } $ failure = true ; goto RETRY_COMMAND ; } } return $ response ; }
Ensures that a command is executed one more time on connection failure.

The connection to the node that generated the error is evicted from the
pool before trying to fetch an updated slots map from another node. If
the new slots map points to an unreachable server the client gives up and
throws the exception as the nodes participating in the cluster may still
have to agree that something changed in the configuration of the cluster.

@param CommandInterface $command Command instance.
@param string           $method  Actual method.

@return mixed
Ensures that a command is executed one more time on connection failure .