private boolean updateMeta(final HRegion r, long masterSystemTime) {
    if (this.server.isStopped() || this.rsServices.isStopping()) {
      return false;
    }
    // Object we do wait/notify on. Make it boolean. If set, we're done.
    // Else, wait.
    final AtomicBoolean signaller = new AtomicBoolean(false);
    PostOpenDeployTasksThread t =
      new PostOpenDeployTasksThread(r, this.server, this.rsServices, signaller, masterSystemTime);
    t.start();
    // Post open deploy task:
    // meta => update meta location in ZK
    // other region => update meta
    while (
      !signaller.get() && t.isAlive() && !this.server.isStopped() && !this.rsServices.isStopping()
        && isRegionStillOpening()
    ) {
      synchronized (signaller) {
        try {
          // Wait for 10 seconds, so that server shutdown
          // won't take too long if this thread happens to run.
          if (!signaller.get()) signaller.wait(10000);
        } catch (InterruptedException e) {
          // Go to the loop check.
        }
      }
    }
    // Is thread still alive? We may have left above loop because server is
    // stopping or we timed out the edit. Is so, interrupt it.
    if (t.isAlive()) {
      if (!signaller.get()) {
        // Thread still running; interrupt
        LOG.debug("Interrupting thread " + t);
        t.interrupt();
      }
      try {
        t.join();
      } catch (InterruptedException ie) {
        LOG.warn("Interrupted joining " + r.getRegionInfo().getRegionNameAsString(), ie);
        Thread.currentThread().interrupt();
      }
    }

    // Was there an exception opening the region? This should trigger on
    // InterruptedException too. If so, we failed.
    return (!Thread.interrupted() && t.getException() == null);
  }
Update ZK or META. This can take a while if for example the hbase:meta is not available -- if
server hosting hbase:meta crashed and we are waiting on it to come back -- so run in a thread
and keep updating znode state meantime so master doesn't timeout our region-in-transition.
Caller must cleanup region if this fails.
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRegionHandler.java