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

This commit is contained in:
Akira Ajisaka 2020-09-14 11:34:52 +09:00 committed by GitHub
parent d2779de3f5
commit c78d18023d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,6 +29,7 @@
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 @@ private Object invoke(String nsId, int retryCount, final Method method,
* @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 || if (ioe instanceof ConnectTimeoutException ||
ioe instanceof ConnectTimeoutException ||
ioe instanceof EOFException || ioe instanceof EOFException ||
ioe instanceof SocketException ||
ioe instanceof StandbyException) { ioe instanceof StandbyException) {
return true; return true;
} }