private void processSyncEvents() {

    while (processingEvents) {
      LdapSyncEventEntity event;
      synchronized (eventQueue) {
        if (processingEvents) {
          event = eventQueue.poll();
          if (event == null) {
            processingEvents = false;
            return;
          }
        } else {
          break;
        }
      }

      event.setStatus(LdapSyncEventEntity.Status.RUNNING);
      event.setStatusDetail("Running LDAP sync.");
      event.setStartTime(System.currentTimeMillis());

      try {

        populateLdapSyncEvent(event, syncLdap(event));

        event.setStatus(LdapSyncEventEntity.Status.COMPLETE);
        event.setStatusDetail("Completed LDAP sync.");
      } catch (Exception e) {
        event.setStatus(LdapSyncEventEntity.Status.ERROR);
        String msg = "Caught exception running LDAP sync. ";
        if (e.getCause() instanceof OperationNotSupportedException) {
          msg += "LDAP server may not support search results pagination. " +
            "Try to turn the pagination off.";
        }
        event.setStatusDetail(msg + e.getMessage());
        LOG.error(msg, e);
      } finally {
        event.setEndTime(System.currentTimeMillis());
      }
    }
  }
Ensure that sync events are being processed.
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/LdapSyncEventResourceProvider.java