@edu.umd.cs.findbugs.annotations.SuppressWarnings(value = "WA_NOT_IN_LOOP")
  boolean attemptToJoin() throws MemberStartupException {
    SearchState<ID> state = searchState;

    // send a join request to the coordinator and wait for a response
    ID coord = state.possibleCoordinator;
    if (state.alreadyTried.contains(coord)) {
      logger.info("Probable coordinator is still {} - waiting for a join-response", coord);
    } else {
      logger.info("Attempting to join the distributed system through coordinator " + coord
          + " using address " + localAddress);
      int port = services.getHealthMonitor().getFailureDetectionPort();
      JoinRequestMessage<ID> req = new JoinRequestMessage<>(coord, localAddress,
          services.getAuthenticator().getCredentials(coord), port,
          services.getMessenger().getRequestId());
      services.getMessenger().send(req);
    }

    JoinResponseMessage<ID> response;
    try {
      response = waitForJoinResponse();
    } catch (InterruptedException e) {
      Thread.currentThread().interrupt();
      return false;
    }

    if (response == null) {
      if (!isJoined) {
        logger.debug("received no join response");
      }
      return isJoined;
    }

    logger.info("received join response {}", response);
    joinResponse[0] = null;
    String failReason = response.getRejectionMessage();
    if (failReason != null) {
      if (failReason.contains("Rejecting the attempt of a member using an older version")
          || failReason.contains("15806")
          || failReason.contains("ForcedDisconnectException")) {
        throw new MemberStartupException(failReason);
      }
      throw new SecurityException(failReason);
    }

    throw new RuntimeException("Join Request Failed with response " + response);
  }
send a join request and wait for a reply. Process the reply. This may throw a
MemberStartupException or an exception from the authenticator, if present.

@return true if the attempt succeeded, false if it timed out
geode-membership/src/main/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeave.java