code: @Override
    public void foundActiveMaster(Protocol protocol) throws SQLException {
      if (isExplicitClosed()) {
        proxy.lock.lock();
        try {
          protocol.close();
        } finally {
          proxy.lock.unlock();
        }
        return;
      }
      syncConnection(this.currentProtocol, protocol);
      proxy.lock.lock();
      try {
        if (currentProtocol != null && !currentProtocol.isClosed()) {
          currentProtocol.close();
        }
        currentProtocol = protocol;
      } finally {
        proxy.lock.unlock();
      }
  
      resetMasterFailoverData();
      FailoverLoop.removeListener(this);
    }
docs: method called when a new Master connection is found after a fallback.
  
  @param protocol the new active connection