HADOOP-14966. Handle JDK-8071638 for hadoop-common. Contributed by Bibin A Chundatt.

This commit is contained in:
Naganarasimha 2017-10-23 23:41:38 +05:30
parent 4b00c9a47f
commit 6b8122458e

View File

@ -40,14 +40,16 @@ static void logThrowableFromAfterExecute(Runnable r, Throwable t) {
//For additional information, see: https://docs.oracle //For additional information, see: https://docs.oracle
// .com/javase/7/docs/api/java/util/concurrent/ThreadPoolExecutor // .com/javase/7/docs/api/java/util/concurrent/ThreadPoolExecutor
// .html#afterExecute(java.lang.Runnable,%20java.lang.Throwable) . // .html#afterExecute(java.lang.Runnable,%20java.lang.Throwable)
if (t == null && r instanceof Future<?>) { // Handle JDK-8071638
if (t == null && r instanceof Future<?> && ((Future<?>) r).isDone()) {
try { try {
((Future<?>) r).get(); ((Future<?>) r).get();
} catch (ExecutionException ee) { } catch (ExecutionException ee) {
LOG.warn("Execution exception when running task in " + LOG.warn(
Thread.currentThread().getName()); "Execution exception when running task in " + Thread.currentThread()
.getName());
t = ee.getCause(); t = ee.getCause();
} catch (InterruptedException ie) { } catch (InterruptedException ie) {
LOG.warn("Thread (" + Thread.currentThread() + ") interrupted: ", ie); LOG.warn("Thread (" + Thread.currentThread() + ") interrupted: ", ie);