protected boolean timeOutActionNeeded(HostRoleStatus status, Stage stage,
      Host host, String role, long currentTime, long taskTimeout) throws
    AmbariException {
    if (( !status.equals(HostRoleStatus.QUEUED) ) &&
        ( ! status.equals(HostRoleStatus.IN_PROGRESS) )) {
      return false;
    }

    // tasks are held in a variety of in-memory maps that require a hostname key
    // host being null is ok - that means it's a server-side task
    String hostName = (null == host) ? null : host.getHostName();

    // If we have other command in progress for this stage do not timeout this one
    if (hasCommandInProgress(stage, hostName)
            && !status.equals(HostRoleStatus.IN_PROGRESS)) {
      return false;
    }
    if (currentTime >= stage.getLastAttemptTime(hostName, role)
        + taskTimeout) {
      return true;
    }
    return false;
  }
Checks if timeout is required.
@param status      the status of the current role
@param stage       the stage
@param host        the host object; can be {@code null} for server-side tasks
@param role        the role
@param currentTime the current
@param taskTimeout the amount of time to determine timeout
@return {@code true} if timeout is needed
@throws AmbariException
ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java