Github user linwen commented on a diff in the pull request:
https://github.com/apache/incubator-hawq/pull/58#discussion_r43363505
--- Diff:
src/backend/resourcemanager/resourcebroker/resourcebroker_LIBYARN_proc.c ---
@@ -1276,20 +1277,43 @@ int RB2YARN_registerYARNApplication(void)
elog(WARNING, "YARN mode resource broker failed to create
application "
"in YARN resource manager. %s",
getErrorMessage());
+ return yarnres;
}
- else {
- elog(LOG, "YARN mode resource broker created job in YARN
resource "
- "manager %s as new application %s assigned to
queue %s.",
- YARNJobID,
- YARNAppName.Str,
- YARNQueueName.Str);
- ResBrokerStartTime = gettime_microsec();
+ elog(LOG, "YARN mode resource broker created job in YARN resource "
+ "manager %s as new application %s assigned to queue
%s.",
+ YARNJobID,
+ YARNAppName.Str,
+ YARNQueueName.Str);
- elog(LOG, "YARN mode resource broker registered new "
- "YARN application. Start time stamp
"UINT64_FORMAT,
- ResBrokerStartTime);
+ /* check if hawq is registered successfully in Hadoop Yarn.
+ * if not, kill application from Hadoop Yarn.
+ */
+ LibYarnApplicationReport_t *applicationReport = NULL;
+ result = getApplicationReport(LIBYARNClient, YARNJobID,
&applicationReport);
+ if (result != FUNCTION_SUCCEEDED || applicationReport == NULL) {
+ elog(WARNING, "YARN mode resource broker failed to get
application report, "
+ "so kill it from Hadoop Yarn.");
+ result = forceKillJob(LIBYARNClient, YARNJobID);
+ if (result != FUNCTION_SUCCEEDED)
+ elog(WARNING, "YARN mode resource broker kill job
failed.");
+ return FUNCTION_FAILED;
}
+ if (applicationReport->progress < 0.5) {
+ elog(WARNING, "YARN mode resource broker failed to register
itself in Hadoop Yarn."
+ "Got progress:%f, and try to kill
application from Hadoop Yarn", applicationReport->progress);
+ result = forceKillJob(LIBYARNClient, YARNJobID);
+ if (result != FUNCTION_SUCCEEDED)
+ elog(WARNING, "YARN mode resource broker kill job
failed.");
+ return FUNCTION_FAILED;
+ }
+
+ ResBrokerStartTime = gettime_microsec();
+
+ elog(LOG, "YARN mode resource broker registered new "
+ "YARN application. Progress:%f, Start time stamp
"UINT64_FORMAT,
+ applicationReport->progress, ResBrokerStartTime);
+
return yarnres;
}
--- End diff --
accepted.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---