Skip to content

Commit 60fa153

Browse files
author
Prabhu Joseph
committed
YARN-10240. Prevent Fatal CancelledException in TimelineV2Client when stopping
Contributed by Tarun Parimi.
1 parent e069a06 commit 60fa153

File tree

1 file changed

+4
-1
lines changed
  • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/api/impl

1 file changed

+4
-1
lines changed

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/api/impl/TimelineV2ClientImpl.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import java.util.concurrent.FutureTask;
3333
import java.util.concurrent.LinkedBlockingQueue;
3434
import java.util.concurrent.TimeUnit;
35+
import java.util.concurrent.CancellationException;
3536

3637
import javax.ws.rs.core.MediaType;
3738
import javax.ws.rs.core.MultivaluedMap;
@@ -575,9 +576,11 @@ public void dispatchEntities(boolean sync,
575576
} catch (ExecutionException e) {
576577
throw new YarnException("Failed while publishing entity",
577578
e.getCause());
578-
} catch (InterruptedException e) {
579+
} catch (InterruptedException | CancellationException e) {
579580
Thread.currentThread().interrupt();
580581
throw new YarnException("Interrupted while publishing entity", e);
582+
} catch (Exception e) {
583+
throw new YarnException("Encountered error while publishing entity", e);
581584
}
582585
}
583586
}

0 commit comments

Comments
 (0)