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

hbase git commit: HBASE-17475 Stack overflow in AsyncProcess if retry too much (Allan Yang)

Repository: hbase
Updated Branches:
  refs/heads/branch-1.3 dc72e0d4f -> f840bd196


HBASE-17475 Stack overflow in AsyncProcess if retry too much (Allan Yang)


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

Branch: refs/heads/branch-1.3
Commit: f840bd196fd696621d61c75875f5d2d1d996dd0f
Parents: dc72e0d
Author: tedyu <yu...@gmail.com>
Authored: Wed Jan 18 10:29:04 2017 -0800
Committer: tedyu <yu...@gmail.com>
Committed: Wed Jan 18 10:29:04 2017 -0800

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


http://git-wip-us.apache.org/repos/asf/hbase/blob/f840bd19/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncProcess.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncProcess.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncProcess.java
index 32de1e3..d5f99f1 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncProcess.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncProcess.java
@@ -1053,8 +1053,11 @@ class AsyncProcess {
         }
 
         // 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 {