Permalink
Browse files

Fix a bug in failure checking on appmaster shutdown

  • Loading branch information...
1 parent 7d41602 commit 1487057c6188016868ad23b51645432634b9cf70 @jwills jwills committed Jul 2, 2012
@@ -36,7 +36,7 @@ public int run(String[] args) throws Exception {
while (service.hasRunningContainers()) {
Thread.sleep(1000);
}
- service.stop();
+ service.stopAndWait();
return 0;
}
@@ -168,7 +168,7 @@ protected void shutDown() {
FinishApplicationMasterRequest finishReq = Records.newRecord(
FinishApplicationMasterRequest.class);
finishReq.setAppAttemptId(getApplicationAttemptId());
- if (state() == State.FAILED || totalFailures.incrementAndGet() > parameters.getAllowedFailures()) {
+ if (state() == State.FAILED || totalFailures.get() > parameters.getAllowedFailures()) {
//TODO: diagnostics
finishReq.setFinishApplicationStatus(FinalApplicationStatus.FAILED);
} else {

0 comments on commit 1487057

Please sign in to comment.