private long determineTimeout(ExecutionCommand executionCommand) {
    Map<String, String> params = executionCommand.getCommandParams();
    String paramsTimeout = (params == null) ? null : params.get(ExecutionCommand.KeyNames.COMMAND_TIMEOUT);
    Long timeout;

    try {
      timeout = (paramsTimeout == null)
          ? null
          : (Long.parseLong(paramsTimeout) * 1000L); // Convert seconds to milliseconds
    } catch (NumberFormatException e) {
      timeout = null;
    }

    // If a configured timeout value is not set for the command, attempt to get the configured
    // default
    if (timeout == null) {
      Integer defaultTimeoutSeconds = configuration.getDefaultServerTaskTimeout();
      if (defaultTimeoutSeconds != null) {
        timeout = defaultTimeoutSeconds * 1000L; // convert seconds to milliseconds
      }
    }

    // If a timeout value was not determined, return the hard-coded timeout value, else return the
    // determined timeout value.
    return (timeout == null)
        ? DEFAULT_EXECUTION_TIMEOUT_MS
        : ((timeout < 0) ? 0 : timeout);
  }
Determine what the timeout for this action/task should be.
<p/>
If the timeout value is not set in the command parameter map (under the key
ExecutionCommand.KeyNames.COMMAND_TIMEOUT or "command_timeout", the default timeout value will
be used.  It is expected that the timeout value stored in the command parameter map (if any) is
in seconds.

@param executionCommand the ExecutionCommand for the relevant task
@return a long declaring the action/task's timeout
ambari-server/src/main/java/org/apache/ambari/server/serveraction/ServerActionExecutor.java