HBASE-17475 Stack overflow in AsyncProcess if retry too much

Signed-off-by: zhangduo <zhangduo@apache.org>
This commit is contained in:
Allan Yang 2017-01-17 15:47:25 +08:00 committed by zhangduo
parent 354e213852
commit 2b5292c5f9
1 changed files with 4 additions and 1 deletions

View File

@ -1106,8 +1106,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 {