private static void elderSyncWait(InternalDistributedSystem sys,
      InternalDistributedMember newElder, DLockService dls) {
    GrantorRequestContext grc = sys.getGrantorRequestContext();
    grc.waitingToChangeElder = true;
    final String message = String.format(
        "GrantorRequestProcessor.elderSyncWait: The current Elder %s is waiting for the new Elder %s.",
        grc.currentElder, newElder);
    while (grc.waitingToChangeElder) {
      logger.info(LogMarker.DLS_MARKER, message);
      boolean interrupted = Thread.interrupted();
      try {
        grc.elderLockCondition.await(sys.getConfig().getMemberTimeout());
      } catch (InterruptedException e) {
        interrupted = true;
        sys.getCancelCriterion().checkCancelInProgress(e);
      } finally {
        if (interrupted) {
          Thread.currentThread().interrupt();
        }
      }
    }
  }
Waits until elder recovery can proceed safely. Currently this is done by waiting until any in
progress calls to an old elder are complete

@param elderId the member id of the new elder; null if new elder is local
geode-core/src/main/java/org/apache/geode/distributed/internal/locks/GrantorRequestProcessor.java