diff --git a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterRpcServer.java b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterRpcServer.java index 30c6cdcf2f16a..bc723cad66c14 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterRpcServer.java +++ b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterRpcServer.java @@ -78,6 +78,7 @@ import org.apache.hadoop.hdfs.protocolPB.AsyncRpcProtocolPBUtil; import org.apache.hadoop.hdfs.server.federation.router.async.ApplyFunction; import org.apache.hadoop.hdfs.server.federation.router.async.AsyncCatchFunction; +import org.apache.hadoop.hdfs.server.federation.router.async.CatchFunction; import org.apache.hadoop.thirdparty.com.google.common.cache.CacheBuilder; import org.apache.hadoop.thirdparty.com.google.common.cache.CacheLoader; import org.apache.hadoop.thirdparty.com.google.common.cache.LoadingCache; @@ -832,7 +833,7 @@ T invokeAtAvailableNsAsync(RemoteMethod method, Class clazz) throw ioe; } nss.removeIf(n -> n.getNameserviceId().equals(nsId)); - invokeOnNs(method, clazz, io, nss); + invokeOnNsAsync(method, clazz, io, nss); }, IOException.class); } else { // If not have default NS. @@ -907,13 +908,14 @@ T invokeOnNsAsync(RemoteMethod method, Class clazz, IOException ioe, }); }); - asyncCatch((AsyncCatchFunction)(ret, ex) -> { + asyncCatch((CatchFunction)(ret, ex) -> { LOG.debug("Failed to invoke {} on namespace {}", method, nsId, ex); // Ignore the exception and try on other namespace, if the tried // namespace is unavailable, else throw the received exception. if (!clientProto.isUnavailableSubclusterException(ex)) { throw ex; } + return null; }, IOException.class); });