YARN-10240. Prevent Fatal CancelledException in TimelineV2Client when stopping

Contributed by Tarun Parimi.
This commit is contained in:
Prabhu Joseph 2020-04-21 12:01:29 +05:30
parent e069a06137
commit 60fa15366e

View File

@ -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);
}
}
}