Repository: ambari Updated Branches: refs/heads/branch-1.7.0 464537311 -> d8748e299
Revert "AMBARI-8220. Hadoop install with yum timesout after 10 mins (alejandro)" This reverts commit d10503b44ff6aba40ca216ff11732d1a4aa060a8. Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/d8748e29 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/d8748e29 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/d8748e29 Branch: refs/heads/branch-1.7.0 Commit: d8748e299801a485ca4250c04d07962e2088d747 Parents: 4645373 Author: Yusaku Sako <yus...@hortonworks.com> Authored: Fri Nov 7 19:58:13 2014 -0800 Committer: Yusaku Sako <yus...@hortonworks.com> Committed: Fri Nov 7 19:58:13 2014 -0800 ---------------------------------------------------------------------- .../src/main/python/ambari_agent/PythonExecutor.py | 7 +++---- ambari-server/conf/unix/ambari.properties | 2 +- .../ambari/server/configuration/Configuration.java | 2 +- .../controller/AmbariManagementControllerImpl.java | 17 +++-------------- 4 files changed, 8 insertions(+), 20 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/d8748e29/ambari-agent/src/main/python/ambari_agent/PythonExecutor.py ---------------------------------------------------------------------- diff --git a/ambari-agent/src/main/python/ambari_agent/PythonExecutor.py b/ambari-agent/src/main/python/ambari_agent/PythonExecutor.py index d504183..874b70b 100644 --- a/ambari-agent/src/main/python/ambari_agent/PythonExecutor.py +++ b/ambari-agent/src/main/python/ambari_agent/PythonExecutor.py @@ -97,7 +97,7 @@ class PythonExecutor: process.communicate() self.event.set() thread.join() - return self.prepare_process_result(process, tmpoutfile, tmperrfile, tmpstructedoutfile, timeout=timeout) + return self.prepare_process_result(process, tmpoutfile, tmperrfile, tmpstructedoutfile) else: holder = Holder(pythonCommand, tmpoutfile, tmperrfile, tmpstructedoutfile, handle) @@ -105,14 +105,13 @@ class PythonExecutor: background.start() return {"exitcode": 777} - def prepare_process_result (self, process, tmpoutfile, tmperrfile, tmpstructedoutfile, timeout=None): + def prepare_process_result (self, process, tmpoutfile, tmperrfile, tmpstructedoutfile): out, error, structured_out = self.read_result_from_files(tmpoutfile, tmperrfile, tmpstructedoutfile) # Building results returncode = process.returncode if self.python_process_has_been_killed: - error = str(error) + "\n Python script has been killed due to timeout" + \ - (" after waiting %s secs" % str(timeout) if timeout else "") + error = str(error) + "\n Python script has been killed due to timeout" returncode = 999 result = self.condenseOutput(out, error, returncode, structured_out) logger.info("Result: %s" % result) http://git-wip-us.apache.org/repos/asf/ambari/blob/d8748e29/ambari-server/conf/unix/ambari.properties ---------------------------------------------------------------------- diff --git a/ambari-server/conf/unix/ambari.properties b/ambari-server/conf/unix/ambari.properties index 4076f15..6539f8e 100644 --- a/ambari-server/conf/unix/ambari.properties +++ b/ambari-server/conf/unix/ambari.properties @@ -47,7 +47,7 @@ server.execution.scheduler.maxDbConnections=5 server.execution.scheduler.misfire.toleration.minutes=480 # Default timeout in seconds before task is killed -agent.task.timeout=900 +agent.task.timeout=600 # thread pool maximums client.threadpool.size.max=25 http://git-wip-us.apache.org/repos/asf/ambari/blob/d8748e29/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java b/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java index ab94626..0734cfb 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java @@ -243,7 +243,7 @@ public class Configuration { public static final String PARALLEL_STAGE_EXECUTION_KEY = "server.stages.parallel"; public static final String AGENT_TASK_TIMEOUT_KEY = "agent.task.timeout"; - public static final String AGENT_TASK_TIMEOUT_DEFAULT = "900"; + public static final String AGENT_TASK_TIMEOUT_DEFAULT = "600"; public static final String CUSTOM_ACTION_DEFINITION_KEY = "custom.action.definitions"; private static final String CUSTOM_ACTION_DEFINITION_DEF_VALUE = http://git-wip-us.apache.org/repos/asf/ambari/blob/d8748e29/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java index f4fe910..a409078 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java @@ -1579,8 +1579,7 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle if (commandParams == null) { // if not defined commandParams = new TreeMap<String, String>(); } - String agentDefaultCommandTimeout = configs.getDefaultAgentTaskTimeout(); - String scriptCommandTimeout = ""; + String commandTimeout = configs.getDefaultAgentTaskTimeout(); /* * This script is only used for * default commands like INSTALL/STOP/START @@ -1591,7 +1590,7 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle commandParams.put(SCRIPT, script.getScript()); commandParams.put(SCRIPT_TYPE, script.getScriptType().toString()); if (script.getTimeout() > 0) { - scriptCommandTimeout = String.valueOf(script.getTimeout()); + commandTimeout = String.valueOf(script.getTimeout()); } } else { String message = String.format("Component %s of service %s has no " + @@ -1599,17 +1598,7 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle throw new AmbariException(message); } } - - String actualTimeout = (!scriptCommandTimeout.equals("") ? scriptCommandTimeout : agentDefaultCommandTimeout); - - // Because the INSTALL command can take much longer than typical commands, set the timeout to be the max - // between the script's service component timeout and the agent default timeout. - if (roleCommand.equals(RoleCommand.INSTALL) && !agentDefaultCommandTimeout.equals("") && - Integer.parseInt(actualTimeout) < Integer.parseInt(agentDefaultCommandTimeout)) { - scriptCommandTimeout = agentDefaultCommandTimeout; - } - - commandParams.put(COMMAND_TIMEOUT, scriptCommandTimeout); + commandParams.put(COMMAND_TIMEOUT, commandTimeout); commandParams.put(SERVICE_PACKAGE_FOLDER, serviceInfo.getServicePackageFolder()); commandParams.put(HOOKS_FOLDER, stackInfo.getStackHooksFolder());