YARN-10240. Prevent Fatal CancelledException in TimelineV2Client when stopping
Contributed by Tarun Parimi.
This commit is contained in:
parent
e069a06137
commit
60fa15366e
|
@ -32,6 +32,7 @@ import java.util.concurrent.Executors;
|
||||||
import java.util.concurrent.FutureTask;
|
import java.util.concurrent.FutureTask;
|
||||||
import java.util.concurrent.LinkedBlockingQueue;
|
import java.util.concurrent.LinkedBlockingQueue;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
import java.util.concurrent.CancellationException;
|
||||||
|
|
||||||
import javax.ws.rs.core.MediaType;
|
import javax.ws.rs.core.MediaType;
|
||||||
import javax.ws.rs.core.MultivaluedMap;
|
import javax.ws.rs.core.MultivaluedMap;
|
||||||
|
@ -575,9 +576,11 @@ public class TimelineV2ClientImpl extends TimelineV2Client {
|
||||||
} catch (ExecutionException e) {
|
} catch (ExecutionException e) {
|
||||||
throw new YarnException("Failed while publishing entity",
|
throw new YarnException("Failed while publishing entity",
|
||||||
e.getCause());
|
e.getCause());
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException | CancellationException e) {
|
||||||
Thread.currentThread().interrupt();
|
Thread.currentThread().interrupt();
|
||||||
throw new YarnException("Interrupted while publishing entity", e);
|
throw new YarnException("Interrupted while publishing entity", e);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new YarnException("Encountered error while publishing entity", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue