private Flow schedule(MasterProcedureEnv env) throws ProcedureSuspendedException {
    MutableBoolean submitted = new MutableBoolean(false);
    int inTransitionCount = submitUnassignProcedure(env, p -> {
      submitted.setTrue();
      addChildProcedure(p);
    });
    if (inTransitionCount > 0 && submitted.isFalse()) {
      // we haven't scheduled any unassign procedures and there are still regions in
      // transition, sleep for a while and try again
      if (retryCounter == null) {
        retryCounter = ProcedureUtil.createRetryCounter(env.getMasterConfiguration());
      }
      long backoffMillis = retryCounter.getBackoffTimeAndIncrementAttempts();
      LOG.info(
        "There are still {} region(s) in transition for closing regions of table {}"
          + " when executing {}, suspend {}secs and try again later",
        inTransitionCount, tableName, getClass().getSimpleName(), backoffMillis / 1000);
      suspend((int) backoffMillis, true);
    }
    setNextState(getConfirmState());
    return Flow.HAS_MORE_STATE;
  }
Base class for unassigning table regions.
hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/AbstractCloseTableRegionsProcedure.java