You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by wa...@apache.org on 2018/12/12 19:58:32 UTC
[3/3] hadoop git commit: YARN-9112. [Submarine] Support polling
applicationId when it's not ready in cluster. (Zhankun Tang via wangda)
YARN-9112. [Submarine] Support polling applicationId when it's not ready in cluster. (Zhankun Tang via wangda)
Change-Id: I73d73f3d631b28fb9866faa56571839b13824a97
(cherry picked from commit 9fba6cc2471db8df9ca6da7b9df378e3072dfeb2)
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/29e4e5f6
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/29e4e5f6
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/29e4e5f6
Branch: refs/heads/branch-3.2
Commit: 29e4e5f62c3cd3a2bbd3160d8721f518301765e0
Parents: ef0f835
Author: Wangda Tan <wa...@apache.org>
Authored: Wed Dec 12 11:44:58 2018 -0800
Committer: Wangda Tan <wa...@apache.org>
Committed: Wed Dec 12 11:52:16 2018 -0800
----------------------------------------------------------------------
.../yarnservice/YarnServiceJobSubmitter.java | 24 ++++++++++++++++----
1 file changed, 20 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hadoop/blob/29e4e5f6/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-submarine/src/main/java/org/apache/hadoop/yarn/submarine/runtimes/yarnservice/YarnServiceJobSubmitter.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-submarine/src/main/java/org/apache/hadoop/yarn/submarine/runtimes/yarnservice/YarnServiceJobSubmitter.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-submarine/src/main/java/org/apache/hadoop/yarn/submarine/runtimes/yarnservice/YarnServiceJobSubmitter.java
index 8cc9794..b92438d 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-submarine/src/main/java/org/apache/hadoop/yarn/submarine/runtimes/yarnservice/YarnServiceJobSubmitter.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-submarine/src/main/java/org/apache/hadoop/yarn/submarine/runtimes/yarnservice/YarnServiceJobSubmitter.java
@@ -866,10 +866,26 @@ public class YarnServiceJobSubmitter implements JobSubmitter {
}
String appStatus=appAdminClient.getStatusString(serviceSpec.getName());
- Service app=ServiceApiUtil.jsonSerDeser.fromJson(appStatus);
- if(app.getId() == null) {
- throw new YarnException("Can't get application id for Service " +
- serviceSpec.getName());
+ Service app = ServiceApiUtil.jsonSerDeser.fromJson(appStatus);
+
+ // Retry multiple times if applicationId is null
+ int maxRetryTimes = 30;
+ int count = 0;
+ while (app.getId() == null && count < maxRetryTimes) {
+ LOG.info("Waiting for application Id. AppStatusString=\n {}", appStatus);
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ throw new IOException(e);
+ }
+ appStatus = appAdminClient.getStatusString(serviceSpec.getName());
+ app = ServiceApiUtil.jsonSerDeser.fromJson(appStatus);
+ count++;
+ }
+ // Retry timeout
+ if (app.getId() == null) {
+ throw new YarnException(
+ "Can't get application id for Service " + serviceSpec.getName());
}
ApplicationId appid = ApplicationId.fromString(app.getId());
appAdminClient.stop();
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org