Browse Source

AMBARI-18545. Kerberos server actions should not timeout in minutes as specified in configuration (rlevas)

Robert Levas 9 years ago
parent
commit
367c2c95b2

+ 3 - 3
ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java

@@ -2889,7 +2889,7 @@ public class KerberosHelperImpl implements KerberosHelper {
           event,
           commandParameters,
           "Create Principals",
-          configuration.getDefaultServerTaskTimeout());
+          Math.max(ServerAction.DEFAULT_LONG_RUNNING_TASK_TIMEOUT_SECONDS, configuration.getDefaultServerTaskTimeout()));
 
       RoleGraph roleGraph = roleGraphFactory.createNew(roleCommandOrder);
       roleGraph.build(stage);
@@ -2912,7 +2912,7 @@ public class KerberosHelperImpl implements KerberosHelper {
           event,
           commandParameters,
           "Destroy Principals",
-          configuration.getDefaultServerTaskTimeout());
+          Math.max(ServerAction.DEFAULT_LONG_RUNNING_TASK_TIMEOUT_SECONDS, configuration.getDefaultServerTaskTimeout()));
 
       RoleGraph roleGraph = roleGraphFactory.createNew(roleCommandOrder);
       roleGraph.build(stage);
@@ -2958,7 +2958,7 @@ public class KerberosHelperImpl implements KerberosHelper {
           event,
           commandParameters,
           "Create Keytabs",
-          configuration.getDefaultServerTaskTimeout());
+          Math.max(ServerAction.DEFAULT_LONG_RUNNING_TASK_TIMEOUT_SECONDS, configuration.getDefaultServerTaskTimeout()));
 
       RoleGraph roleGraph = roleGraphFactory.createNew(roleCommandOrder);
       roleGraph.build(stage);

+ 6 - 0
ambari-server/src/main/java/org/apache/ambari/server/serveraction/ServerAction.java

@@ -33,6 +33,12 @@ public interface ServerAction {
   public static final String ACTION_NAME      = "ACTION_NAME";
   public static final String ACTION_USER_NAME = "ACTION_USER_NAME";
 
+  /**
+   * The default timeout (in seconds) to use for potentially long running tasks such as creating
+   * Kerberos principals and generating Kerberos keytab files
+   */
+  int DEFAULT_LONG_RUNNING_TASK_TIMEOUT_SECONDS = 36000;
+
 
   /**
    * Gets the ExecutionCommand property of this ServerAction.