You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by el...@apache.org on 2017/01/23 23:01:35 UTC

[02/50] [abbrv] hbase git commit: HBASE-17475 Stack overflow in AsyncProcess if retry too much

HBASE-17475 Stack overflow in AsyncProcess if retry too much

Signed-off-by: zhangduo <zh...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/9b38c1a3
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/9b38c1a3
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/9b38c1a3

Branch: refs/heads/HBASE-16961
Commit: 9b38c1a33ce1a7ee41cb14980b3b74e317d30b78
Parents: 4ab95eb
Author: Allan Yang <al...@163.com>
Authored: Tue Jan 17 15:45:48 2017 +0800
Committer: zhangduo <zh...@apache.org>
Committed: Tue Jan 17 15:45:48 2017 +0800

----------------------------------------------------------------------
 .../org/apache/hadoop/hbase/client/AsyncRequestFutureImpl.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/9b38c1a3/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncRequestFutureImpl.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncRequestFutureImpl.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncRequestFutureImpl.java
index 036196e..b0a2798 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncRequestFutureImpl.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncRequestFutureImpl.java
@@ -42,6 +42,7 @@ import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.hbase.CallQueueTooBigException;
 import org.apache.hadoop.hbase.DoNotRetryIOException;
+import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.HRegionInfo;
 import org.apache.hadoop.hbase.HRegionLocation;
 import org.apache.hadoop.hbase.RegionLocations;
@@ -567,8 +568,11 @@ class AsyncRequestFutureImpl<CResult> implements AsyncRequestFuture {
       }
 
       // run all the runnables
+      // HBASE-17475: Do not reuse the thread after stack reach a certain depth to prevent stack overflow
+      // for now, we use HConstants.DEFAULT_HBASE_CLIENT_RETRIES_NUMBER to control the depth
       for (Runnable runnable : runnables) {
-        if ((--actionsRemaining == 0) && reuseThread) {
+        if ((--actionsRemaining == 0) && reuseThread
+            && numAttempt % HConstants.DEFAULT_HBASE_CLIENT_RETRIES_NUMBER != 0) {
           runnable.run();
         } else {
           try {