ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yus...@apache.org
Subject ambari git commit: Revert "AMBARI-8220. Hadoop install with yum timesout after 10 mins (alejandro)"
Date Sat, 08 Nov 2014 05:47:46 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk b6326be3a -> fc136f5e4


Revert "AMBARI-8220. Hadoop install with yum timesout after 10 mins (alejandro)"

This reverts commit 9590cfbd1967b798c793da5dcde8b6e0a8616eb7.


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/fc136f5e
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/fc136f5e
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/fc136f5e

Branch: refs/heads/trunk
Commit: fc136f5e4f9724aadfe1e7437437032a0d739630
Parents: b6326be
Author: Yusaku Sako <yusaku@hortonworks.com>
Authored: Fri Nov 7 21:47:33 2014 -0800
Committer: Yusaku Sako <yusaku@hortonworks.com>
Committed: Fri Nov 7 21:47:33 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/fc136f5e/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/fc136f5e/ambari-server/conf/unix/ambari.properties
----------------------------------------------------------------------
diff --git a/ambari-server/conf/unix/ambari.properties b/ambari-server/conf/unix/ambari.properties
index ed1994c..8563cf2 100644
--- a/ambari-server/conf/unix/ambari.properties
+++ b/ambari-server/conf/unix/ambari.properties
@@ -48,7 +48,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/fc136f5e/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 4f53544..a0d5b39 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
@@ -245,7 +245,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";
   public static final String SHARED_RESOURCES_DIR_KEY = "shared.resources.dir";

http://git-wip-us.apache.org/repos/asf/ambari/blob/fc136f5e/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 4b65cec..4f69dbb 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
@@ -1580,8 +1580,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
@@ -1592,7 +1591,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 " +
@@ -1600,17 +1599,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());


Mime
View raw message