Skip to content

Commit 8ecfc5b

Browse files
committed
TEZ-4270: HeartbeatHandlerBase Does Not Need Stop Condition
1 parent bf616b2 commit 8ecfc5b

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

tez-dag/src/main/java/org/apache/tez/dag/app/HeartbeatHandlerBase.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ public abstract class HeartbeatHandlerBase<T> extends AbstractService {
4242
protected final AppContext appContext;
4343

4444
private ConcurrentMap<T, ReportTime> runningMap;
45-
private volatile boolean stopped;
4645

4746
public HeartbeatHandlerBase(AppContext appContext, int expectedConcurrency, String name) {
4847
super(name);
@@ -70,7 +69,6 @@ public void serviceStart() {
7069

7170
@Override
7271
public void serviceStop() {
73-
stopped = true;
7472
if (timeOutCheckerThread != null) {
7573
timeOutCheckerThread.interrupt();
7674
}
@@ -140,7 +138,7 @@ private class PingChecker implements Runnable {
140138

141139
@Override
142140
public void run() {
143-
while (!stopped && !Thread.currentThread().isInterrupted()) {
141+
while (!Thread.currentThread().isInterrupted()) {
144142
Iterator<Map.Entry<T, ReportTime>> iterator =
145143
runningMap.entrySet().iterator();
146144

@@ -158,7 +156,7 @@ public void run() {
158156
try {
159157
Thread.sleep(timeOutCheckInterval);
160158
} catch (InterruptedException e) {
161-
break;
159+
Thread.currentThread().interrupt();
162160
}
163161
}
164162
}

0 commit comments

Comments
 (0)