hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zjs...@apache.org
Subject [47/50] [abbrv] hadoop git commit: YARN-3646. Applications are getting stuck some times in case of retry policy forever. Contributed by Raju Bairishetti.
Date Fri, 22 May 2015 21:42:05 GMT
YARN-3646. Applications are getting stuck some times in case of retry
policy forever. Contributed by Raju Bairishetti.


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

Branch: refs/heads/YARN-2928
Commit: 369d7c4766341ab6391d649ab2d7abfe46c11280
Parents: 72ff460
Author: Devaraj K <devaraj@apache.org>
Authored: Thu May 21 20:14:44 2015 +0530
Committer: Zhijie Shen <zjshen@apache.org>
Committed: Fri May 22 12:42:58 2015 -0700

----------------------------------------------------------------------
 hadoop-yarn-project/CHANGES.txt                 |  3 ++
 .../yarn/client/api/impl/TestYarnClient.java    | 32 ++++++++++++++++++++
 .../org/apache/hadoop/yarn/client/RMProxy.java  | 15 ++++-----
 3 files changed, 43 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/369d7c47/hadoop-yarn-project/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt
index cb3ecb7..9ec9618 100644
--- a/hadoop-yarn-project/CHANGES.txt
+++ b/hadoop-yarn-project/CHANGES.txt
@@ -619,6 +619,9 @@ Release 2.7.1 - UNRELEASED
     YARN-3694. Fix dead link for TimelineServer REST API.
     (Jagadesh Kiran N via aajisaka)
 
+    YARN-3646. Applications are getting stuck some times in case of retry
+    policy forever. (Raju Bairishetti via devaraj)
+
 Release 2.7.0 - 2015-04-20
 
   INCOMPATIBLE CHANGES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/369d7c47/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestYarnClient.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestYarnClient.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestYarnClient.java
index 511fa4a..bc40b9a 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestYarnClient.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestYarnClient.java
@@ -1265,4 +1265,36 @@ public class TestYarnClient {
             ReservationSystemTestUtil.reservationQ);
     return request;
   }
+
+  @Test(timeout = 30000, expected = ApplicationNotFoundException.class)
+  public void testShouldNotRetryForeverForNonNetworkExceptions() throws Exception {
+    YarnConfiguration conf = new YarnConfiguration();
+    conf.setInt(YarnConfiguration.RESOURCEMANAGER_CONNECT_MAX_WAIT_MS, -1);
+
+    ResourceManager rm = null;
+    YarnClient yarnClient = null;
+    try {
+      // start rm
+      rm = new ResourceManager();
+      rm.init(conf);
+      rm.start();
+
+      yarnClient = YarnClient.createYarnClient();
+      yarnClient.init(conf);
+      yarnClient.start();
+
+      // create invalid application id
+      ApplicationId appId = ApplicationId.newInstance(1430126768L, 10645);
+
+      // RM should throw ApplicationNotFoundException exception
+      yarnClient.getApplicationReport(appId);
+    } finally {
+      if (yarnClient != null) {
+        yarnClient.stop();
+      }
+      if (rm != null) {
+        rm.stop();
+      }
+    }
+  }
 }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/369d7c47/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/RMProxy.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/RMProxy.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/RMProxy.java
index fa8d642..28628f3 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/RMProxy.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/RMProxy.java
@@ -224,19 +224,20 @@ public class RMProxy<T> {
           failoverSleepBaseMs, failoverSleepMaxMs);
     }
 
-    if (waitForEver) {
-      return RetryPolicies.RETRY_FOREVER;
-    }
-
     if (rmConnectionRetryIntervalMS < 0) {
       throw new YarnRuntimeException("Invalid Configuration. " +
           YarnConfiguration.RESOURCEMANAGER_CONNECT_RETRY_INTERVAL_MS +
           " should not be negative.");
     }
 
-    RetryPolicy retryPolicy =
-        RetryPolicies.retryUpToMaximumTimeWithFixedSleep(rmConnectWaitMS,
-            rmConnectionRetryIntervalMS, TimeUnit.MILLISECONDS);
+    RetryPolicy retryPolicy = null;
+    if (waitForEver) {
+      retryPolicy = RetryPolicies.RETRY_FOREVER;
+    } else {
+      retryPolicy =
+          RetryPolicies.retryUpToMaximumTimeWithFixedSleep(rmConnectWaitMS,
+              rmConnectionRetryIntervalMS, TimeUnit.MILLISECONDS);
+    }
 
     Map<Class<? extends Exception>, RetryPolicy> exceptionToPolicyMap =
         new HashMap<Class<? extends Exception>, RetryPolicy>();


Mime
View raw message