@Override
  public void run() {
    while (shouldRun) {
      try {
        synchronized (wakeupSyncObject) {
          if (!activeAwakeRequest) {
            wakeupSyncObject.wait(sleepTime);
          }
          activeAwakeRequest = false;
        }

        doWork();

      } catch (InterruptedException ex) {
        LOG.warn("Scheduler thread is interrupted going to stop", ex);
        shouldRun = false;
      } catch (Exception ex) {
        LOG.warn("Exception received", ex);
        requestsInProgress.clear();
      } catch (Throwable t) {
        LOG.warn("ERROR", t);
        requestsInProgress.clear();
      }
    }
  }
Should be called from another thread when we want scheduler to
make a run ASAP (for example, to process desired configs of SCHs).
The method is guaranteed to return quickly.
ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java