private JobProgressUpdate progressUpdateLog(boolean isProgressLogRequested, Operation operation, HiveConf conf) {
    if (!isProgressLogRequested || !ServiceUtils.canProvideProgressLog(conf)
        || !OperationType.EXECUTE_STATEMENT.equals(operation.getType())) {
      return new JobProgressUpdate(ProgressMonitor.NULL);
    }

    SessionState sessionState = operation.getParentSession().getSessionState();
    long startTime = System.nanoTime();
    int timeOutMs = 8;
    boolean terminated = operation.isDone();
    try {
      while ((sessionState.getProgressMonitor() == null) && !terminated) {
        long remainingMs = (PROGRESS_MAX_WAIT_NS - (System.nanoTime() - startTime)) / 1000000l;
        if (remainingMs <= 0) {
          LOG.debug("timed out and hence returning progress log as NULL");
          return new JobProgressUpdate(ProgressMonitor.NULL);
        }
        terminated = operation.waitToTerminate(Math.min(remainingMs, timeOutMs));
        timeOutMs <<= 1;
      }
    } catch (InterruptedException e) {
      LOG.warn("Error while getting progress update", e);
    }
    ProgressMonitor pm = sessionState.getProgressMonitor();
    return new JobProgressUpdate(pm != null ? pm : ProgressMonitor.NULL);
  }
If this is a background operation run asynchronously,
we block for a duration determined by a step function, before we return
However, if the background operation is complete, we return immediately.
service/src/java/org/apache/hive/service/cli/CLIService.java