hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From w...@apache.org
Subject incubator-hawq git commit: HAWQ-688. Fix infinite loop when hawq fail to register itself to YARN
Date Wed, 20 Apr 2016 06:37:36 GMT
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 76658bc1a -> 59f543237


HAWQ-688. Fix infinite loop when hawq fail to register itself to YARN


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/59f54323
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/59f54323
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/59f54323

Branch: refs/heads/master
Commit: 59f5432373aaa58f32fb6d9299eab62744879ac5
Parents: 76658bc
Author: Wen Lin <wlin@pivotal.io>
Authored: Wed Apr 20 14:35:44 2016 +0800
Committer: Wen Lin <wlin@pivotal.io>
Committed: Wed Apr 20 14:35:44 2016 +0800

----------------------------------------------------------------------
 depends/libyarn/src/CMakeLists.txt                  | 2 +-
 depends/libyarn/src/libyarnclient/LibYarnClient.cpp | 6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/59f54323/depends/libyarn/src/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/depends/libyarn/src/CMakeLists.txt b/depends/libyarn/src/CMakeLists.txt
index c2a3cff..cafe999 100644
--- a/depends/libyarn/src/CMakeLists.txt
+++ b/depends/libyarn/src/CMakeLists.txt
@@ -2,7 +2,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
 
 SET(libyarn_VERSION_MAJOR 0)
 SET(libyarn_VERSION_MINOR 1)
-SET(libyarn_VERSION_PATCH 16)
+SET(libyarn_VERSION_PATCH 17)
 SET(libyarn_VERSION_STRING "${libyarn_VERSION_MAJOR}.${libyarn_VERSION_MINOR}.${libyarn_VERSION_PATCH}")
 SET(libyarn_VERSION_API 1)
 SET(libyarn_ROOT_SOURCES_DIR ${CMAKE_SOURCE_DIR}/src)

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/59f54323/depends/libyarn/src/libyarnclient/LibYarnClient.cpp
----------------------------------------------------------------------
diff --git a/depends/libyarn/src/libyarnclient/LibYarnClient.cpp b/depends/libyarn/src/libyarnclient/LibYarnClient.cpp
index 3c76f92..0cf90fa 100644
--- a/depends/libyarn/src/libyarnclient/LibYarnClient.cpp
+++ b/depends/libyarn/src/libyarnclient/LibYarnClient.cpp
@@ -184,15 +184,19 @@ int LibYarnClient::createJob(string &jobName, string &queue,string
&jobId) {
 
         //3. wait util AM is ACCEPTED and return the AMRMToken
         ApplicationReport report;
-        while (true) {
+        int retry = 10;
+        while (retry > 0) {
             report = applicationClient->getApplicationReport(appId);
             LOG(INFO,"LibYarnClient::createJob, appId[cluster_timestamp:%lld,id:%d], appState:%d",
                     appId.getClusterTimestamp(), appId.getId(), report.getYarnApplicationState());
             if ((report.getAMRMToken().getPassword() != "") && report.getYarnApplicationState()
== YarnApplicationState::ACCEPTED) {
                 break;
             } else {
+                retry--;
                 usleep(1000000L);
             }
+            if (retry == 0)
+                THROW(AccessControlException, "can not register application to YARN");
         }
 
         clientAppId = appId;


Mime
View raw message