@Override
  protected void beforeExec(MasterProcedureEnv env) throws ProcedureSuspendedException {
    RegionStateNode regionNode = getRegionNode(env);
    if (!regionNode.isLockedBy(this)) {
      // The wake up action will be called under the lock inside RegionStateNode for implementing
      // RegionStateNodeLock, so if we call ProcedureUtil.wakeUp where we will acquire the procedure
      // execution lock directly, it may cause dead lock since in normal case procedure execution
      // case, we will acquire the procedure execution lock first and then acquire the lock inside
      // RegionStateNodeLock. This is the reason why we need to schedule the task to a thread pool
      // and execute asynchronously.
      regionNode.lock(this,
        () -> env.getAsyncTaskExecutor().execute(() -> ProcedureFutureUtil.wakeUp(this, env)));
    }
  }
The base class for the remote procedures used to open/close a region.
<p/>
Notice that here we do not care about the result of the remote call, if the remote call is
finished, either succeeded or not, we will always finish the procedure. The parent procedure
should take care of the result and try to reschedule if the result is not good.
hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/RegionRemoteProcedureBase.java