diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncMetaRegionLocator.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncMetaRegionLocator.java index f5b3f92f65..175f8f2219 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncMetaRegionLocator.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncMetaRegionLocator.java @@ -78,7 +78,7 @@ class AsyncMetaRegionLocator { metaRelocateFuture.getAndSet(null).completeExceptionally(error); return; } - LOG.debug("The fetched meta region location is {}" + locs); + LOG.debug("The fetched meta region location is {}", locs); // Here we update cache before reset future, so it is possible that someone can get a // stale value. Consider this: // 1. update cache diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncNonMetaRegionLocator.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncNonMetaRegionLocator.java index 5d5c7c3d6c..1f23a1d985 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncNonMetaRegionLocator.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncNonMetaRegionLocator.java @@ -45,7 +45,6 @@ import java.util.concurrent.ConcurrentMap; import java.util.concurrent.ConcurrentNavigableMap; import java.util.concurrent.ConcurrentSkipListMap; import org.apache.commons.lang3.ObjectUtils; -import org.apache.hadoop.hbase.DoNotRetryIOException; import org.apache.hadoop.hbase.HBaseIOException; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionLocation; @@ -275,7 +274,9 @@ class AsyncNonMetaRegionLocator { } synchronized (tableCache) { tableCache.pendingRequests.remove(req); - if (error instanceof DoNotRetryIOException) { + if (error != null) { + // fail the request itself, no matter whether it is a DoNotRetryIOException, as we have + // already retried several times CompletableFuture future = tableCache.allRequests.remove(req); if (future != null) { future.completeExceptionally(error); diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncRegionLocatorHelper.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncRegionLocatorHelper.java index 5c9c09154e..9ba36f637d 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncRegionLocatorHelper.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncRegionLocatorHelper.java @@ -53,12 +53,12 @@ final class AsyncRegionLocatorHelper { Function cachedLocationSupplier, Consumer addToCache, Consumer removeFromCache) { HRegionLocation oldLoc = cachedLocationSupplier.apply(loc); - LOG.debug("Try updating {} , the old value is {}", loc, oldLoc, exception); + LOG.debug("Try updating {} , the old value is {}, error={}", loc, oldLoc, exception.toString()); if (!canUpdateOnError(loc, oldLoc)) { return; } Throwable cause = findException(exception); - LOG.debug("The actual exception when updating {}", loc, cause); + LOG.debug("The actual exception when updating {} is {}", loc, cause.toString()); if (cause == null || !isMetaClearingException(cause)) { LOG.debug("Will not update {} because the exception is null or not the one we care about", loc); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java index 74d168cc49..0c164c0e31 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java @@ -172,6 +172,7 @@ import org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil; * avoiding port contention if another local HBase instance is already running). *

To preserve test data directories, pass the system property "hbase.testing.preserve.testdir" * setting it to true. + * for UT. */ @InterfaceAudience.Public @SuppressWarnings("deprecation") diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestRpcClientLeaks.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestRpcClientLeaks.java index 4922fd74fe..5c1d37600c 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestRpcClientLeaks.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestRpcClientLeaks.java @@ -116,6 +116,7 @@ public class TestRpcClientLeaks { Table table = connection.getTable(TableName.valueOf(name.getMethodName())); table.get(new Get(Bytes.toBytes("asd"))); connection.close(); + System.out.println("==================="); for (Socket socket : MyRpcClientImpl.savedSockets) { assertTrue("Socket + " + socket + " is not closed", socket.isClosed()); }