YARN-2398. TestResourceTrackerOnHA crashes. Contributed by Ajith S.

This commit is contained in:
Rohith Sharma K S 2016-08-11 11:27:00 +05:30
parent a428d4f50e
commit 666ad0b67b

View File

@ -328,7 +328,7 @@ public void resetFailoverTriggeredFlag(boolean flag) {
private boolean waittingForFailOver() {
int maximumWaittingTime = 50;
int count = 0;
while (!failoverTriggered.get() && count >= maximumWaittingTime) {
while (!failoverTriggered.get() && count <= maximumWaittingTime) {
try {
Thread.sleep(100);
} catch (InterruptedException e) {
@ -336,7 +336,7 @@ private boolean waittingForFailOver() {
}
count++;
}
if (count >= maximumWaittingTime) {
if (count >= maximumWaittingTime && failoverThread != null) {
return false;
}
try {