diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/api/impl/TimelineV2ClientImpl.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/api/impl/TimelineV2ClientImpl.java index 65369568fef..caef9554d62 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/api/impl/TimelineV2ClientImpl.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/api/impl/TimelineV2ClientImpl.java @@ -32,6 +32,7 @@ import java.util.concurrent.FutureTask; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.TimeUnit; +import java.util.concurrent.CancellationException; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MultivaluedMap; @@ -575,9 +576,11 @@ public void dispatchEntities(boolean sync, } catch (ExecutionException e) { throw new YarnException("Failed while publishing entity", e.getCause()); - } catch (InterruptedException e) { + } catch (InterruptedException | CancellationException e) { Thread.currentThread().interrupt(); throw new YarnException("Interrupted while publishing entity", e); + } catch (Exception e) { + throw new YarnException("Encountered error while publishing entity", e); } } }