From 221783b35bb78bda909c2417c7b9687d491fa196 Mon Sep 17 00:00:00 2001 From: Junping Du Date: Wed, 15 Mar 2017 11:48:09 -0700 Subject: [PATCH] YARN-6294. ATS client should better handle Socket closed case. Contributed by Li Lu. --- .../apache/hadoop/yarn/client/api/impl/TimelineConnector.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 b5b5f7759e..bb29d6cbb4 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 @@ -22,6 +22,7 @@ import java.lang.reflect.UndeclaredThrowableException; import java.net.ConnectException; import java.net.HttpURLConnection; +import java.net.SocketException; import java.net.SocketTimeoutException; import java.net.URI; import java.net.URL; @@ -390,7 +391,8 @@ public boolean shouldRetryOn(Exception e) { // Only retry on connection exceptions return (e instanceof ClientHandlerException) && (e.getCause() instanceof ConnectException - || e.getCause() instanceof SocketTimeoutException); + || e.getCause() instanceof SocketTimeoutException + || e.getCause() instanceof SocketException); } }; try {