private void addNewMember(InternalDistributedMember member) {
    // This is the place to cleanup the zombieMembers
    int vmType = member.getVmKind();
    switch (vmType) {
      case ADMIN_ONLY_DM_TYPE:
        handleConsoleStartup(member);
        break;
      case LOCATOR_DM_TYPE:
        stats.setNodes(getDistributionManagerIds().size());
        addMemberEvent(new MemberJoinedEvent(member));
        break;
      case NORMAL_DM_TYPE:
        // Note test is under membersLock
        stats.setNodes(getDistributionManagerIds().size());
        addMemberEvent(new MemberJoinedEvent(member));
        break;
      default:
        throw new InternalGemFireError(String.format("Unknown member type: %s",
            vmType));
    }
  }
Add a membership listener and return other DistributionManagerIds as an atomic operation
geode-core/src/main/java/org/apache/geode/distributed/internal/ClusterDistributionManager.java