public void checkCancelled() throws MembershipClosedException {
    if (services.getCancelCriterion().isCancelInProgress()) {
      throw new MembershipClosedException("Distributed System is shutting down",
          services.getCancelCriterion().generateCancelledException(services.getShutdownCause()));
    }
  }
Check to see if the membership system is being shutdown

@throws MembershipClosedException if the system is shutting down
geode-membership/src/main/java/org/apache/geode/distributed/internal/membership/gms/GMSMembership.java