hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sun...@apache.org
Subject [01/50] [abbrv] hadoop git commit: YARN-6186 Handle InvalidResourceRequestException in native services AM onError [Forced Update!]
Date Tue, 30 May 2017 17:10:21 GMT
Repository: hadoop
Updated Branches:
  refs/heads/yarn-native-services 2f32d3fdd -> c9d9c94ca (forced update)


YARN-6186 Handle InvalidResourceRequestException in native services AM onError


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

Branch: refs/heads/yarn-native-services
Commit: 35a7a20346f2dcc61e726c114fa82d7174802b97
Parents: 9f5b566
Author: Gour Saha <gourksaha@apache.org>
Authored: Wed Feb 15 12:14:51 2017 -0800
Committer: Sunil G <sunilg@apache.org>
Committed: Tue May 30 20:37:31 2017 +0530

----------------------------------------------------------------------
 .../slider/server/appmaster/SliderAppMaster.java  | 18 +++++++++++++++++-
 .../server/appmaster/actions/ActionHalt.java      |  6 ++++++
 2 files changed, 23 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/35a7a203/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/slider/server/appmaster/SliderAppMaster.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/slider/server/appmaster/SliderAppMaster.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/slider/server/appmaster/SliderAppMaster.java
index 611a3e5..a9a6b6b 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/slider/server/appmaster/SliderAppMaster.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/slider/server/appmaster/SliderAppMaster.java
@@ -67,6 +67,7 @@ import org.apache.hadoop.yarn.client.api.async.NMClientAsync;
 import org.apache.hadoop.yarn.client.api.async.impl.NMClientAsyncImpl;
 import org.apache.hadoop.yarn.conf.YarnConfiguration;
 import org.apache.hadoop.yarn.exceptions.InvalidApplicationMasterRequestException;
+import org.apache.hadoop.yarn.exceptions.InvalidResourceRequestException;
 import org.apache.hadoop.yarn.exceptions.YarnException;
 import org.apache.hadoop.yarn.ipc.YarnRPC;
 import org.apache.hadoop.yarn.security.AMRMTokenIdentifier;
@@ -115,6 +116,7 @@ import org.apache.slider.providers.ProviderService;
 import org.apache.slider.providers.SliderProviderFactory;
 import org.apache.slider.providers.slideram.SliderAMClientProvider;
 import org.apache.slider.providers.slideram.SliderAMProviderService;
+import org.apache.slider.server.appmaster.actions.ActionHalt;
 import org.apache.slider.server.appmaster.actions.ActionRegisterServiceInstance;
 import org.apache.slider.server.appmaster.actions.ActionStopSlider;
 import org.apache.slider.server.appmaster.actions.ActionUpgradeContainers;
@@ -1937,7 +1939,21 @@ public class SliderAppMaster extends AbstractSliderLaunchedService
 
   @Override //AMRMClientAsync
   public void onError(Throwable e) {
-    LOG_YARN.info("Ignoring AMRMClientAsync.onError() received {}", e);
+    if (e instanceof InvalidResourceRequestException) {
+      // stop the cluster
+      LOG_YARN.error("AMRMClientAsync.onError() received {}", e, e);
+      signalAMComplete(new ActionStopSlider("stop", EXIT_EXCEPTION_THROWN,
+          FinalApplicationStatus.FAILED,
+          "AMRMClientAsync.onError() received " + e));
+    } else if (e instanceof InvalidApplicationMasterRequestException) {
+      // halt the AM
+      LOG_YARN.error("AMRMClientAsync.onError() received {}", e, e);
+      queue(new ActionHalt(EXIT_EXCEPTION_THROWN,
+          "AMRMClientAsync.onError() received " + e));
+    } else {
+      // ignore and log
+      LOG_YARN.info("Ignoring AMRMClientAsync.onError() received {}", e);
+    }
   }
   
 /* =================================================================== */

http://git-wip-us.apache.org/repos/asf/hadoop/blob/35a7a203/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/slider/server/appmaster/actions/ActionHalt.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/slider/server/appmaster/actions/ActionHalt.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/slider/server/appmaster/actions/ActionHalt.java
index e2ad559..ee1bb72 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/slider/server/appmaster/actions/ActionHalt.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/slider/server/appmaster/actions/ActionHalt.java
@@ -35,6 +35,12 @@ public class ActionHalt extends AsyncAction {
 
   public ActionHalt(
       int status,
+      String text) {
+    this(status, text, 0, TimeUnit.MILLISECONDS);
+  }
+
+  public ActionHalt(
+      int status,
       String text,
       long delay, TimeUnit timeUnit) {
     


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message