Explorar o código

HDFS-15555. RBF: Refresh cacheNS when SocketException occurs. (#2267)

Akira Ajisaka %!s(int64=4) %!d(string=hai) anos
pai
achega
c78d18023d

+ 3 - 2
hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterRpcClient.java

@@ -29,6 +29,7 @@ import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.lang.reflect.Method;
 import java.net.ConnectException;
 import java.net.ConnectException;
 import java.net.InetSocketAddress;
 import java.net.InetSocketAddress;
+import java.net.SocketException;
 import java.util.ArrayList;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collection;
@@ -582,9 +583,9 @@ public class RouterRpcClient {
    * @return If the exception comes from an unavailable subcluster.
    * @return If the exception comes from an unavailable subcluster.
    */
    */
   public static boolean isUnavailableException(IOException ioe) {
   public static boolean isUnavailableException(IOException ioe) {
-    if (ioe instanceof ConnectException ||
-        ioe instanceof ConnectTimeoutException ||
+    if (ioe instanceof ConnectTimeoutException ||
         ioe instanceof EOFException ||
         ioe instanceof EOFException ||
+        ioe instanceof SocketException ||
         ioe instanceof StandbyException) {
         ioe instanceof StandbyException) {
       return true;
       return true;
     }
     }