From bc634c077ba9973372b24c7faf20e23503a97798 Mon Sep 17 00:00:00 2001
From: Ahmed Hussein <50450311+amahussein@users.noreply.github.com>
Date: Mon, 16 Nov 2020 14:55:40 -0600
Subject: [PATCH] YARN-10485. TimelineConnector swallows InterruptedException
(#2450). Contributed by Ahmed Hussein
(cherry picked from commit 0b2510ee1fb2c92d3b7d2b2183e532b7637d93b9)
---
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/pom.xml | 1 -
.../apache/hadoop/yarn/client/api/impl/TimelineConnector.java | 4 +++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/pom.xml b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/pom.xml
index 7f555f92ed6..4ef7b6d7258 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/pom.xml
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/pom.xml
@@ -45,7 +45,6 @@
hadoop-hdfs-client
-
org.apache.hadoop
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/api/impl/TimelineConnector.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/api/impl/TimelineConnector.java
index ca0f307cdb4..0c1cd7be57d 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/api/impl/TimelineConnector.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/api/impl/TimelineConnector.java
@@ -19,6 +19,7 @@
package org.apache.hadoop.yarn.client.api.impl;
import java.io.IOException;
+import java.io.InterruptedIOException;
import java.lang.reflect.UndeclaredThrowableException;
import java.net.ConnectException;
import java.net.HttpURLConnection;
@@ -352,7 +353,8 @@ public class TimelineConnector extends AbstractService {
// sleep for the given time interval
Thread.sleep(retryInterval);
} catch (InterruptedException ie) {
- LOG.warn("Client retry sleep interrupted! ");
+ Thread.currentThread().interrupt();
+ throw new InterruptedIOException("Client retry sleep interrupted!");
}
}
throw new RuntimeException("Failed to connect to timeline server. "