code: public HandleErrorResult handleFailover(SQLException qe, Method method, Object[] args,
        Protocol protocol) throws Throwable {
      if (isExplicitClosed()) {
        throw new SQLException("Connection has been closed !");
      }
      if (setMasterHostFail()) {
        logger.warn(
            "SQL Primary node [{}, conn={}, local_port={}, timeout={}] connection fail. Reason : {}",
            this.currentProtocol.getHostAddress().toString(),
            this.currentProtocol.getServerThreadId(),
            this.currentProtocol.getSocket().getLocalPort(),
            this.currentProtocol.getTimeout(),
            qe.getMessage());
        addToBlacklist(currentProtocol.getHostAddress());
      }
  
      //check that failover is due to kill command
      boolean killCmd = qe != null
          && qe.getSQLState() != null
          && qe.getSQLState().equals("70100")
          && 1927 == qe.getErrorCode();
  
      return primaryFail(method, args, killCmd);
    }
docs: Call when a failover is detected on master connection. Will  : <ol>
  <li> set fail variable</li>
  <li> try to reconnect</li>
  <li> relaunch query if possible</li>
  </ol>
  
  @param method   called method
  @param args     methods parameters
  @param protocol current protocol
  @return a HandleErrorResult object to indicate if query has been relaunched, and the exception
  if not
  @throws Throwable when method and parameters does not exist.