This is an automated email from the ASF dual-hosted git repository.
wangzheng pushed a commit to branch branch-2.4
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/branch-2.4 by this push:
new fe6c75c HBASE-26027 The calling of HTable.batch blocked at
AsyncRequestFuture… (#3419)
fe6c75c is described below
commit fe6c75cb50e33c0b13434726e57dbc50ebdbbabc
Author: bsglz <[email protected]>
AuthorDate: Thu Jul 1 19:16:51 2021 +0800
HBASE-26027 The calling of HTable.batch blocked at AsyncRequestFuture…
(#3419)
* HBASE-26027 The calling of HTable.batch blocked at
AsyncRequestFutureImpl.waitUntilDone caused by ArrayStoreException
(cherry picked from commit 1d6eb77ef8e813ce1050afe6d71954462ab0c28a)
---
.../org/apache/hadoop/hbase/client/AsyncRequestFutureImpl.java | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
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 d2486cc..e982fa2 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
@@ -1140,7 +1140,15 @@ class AsyncRequestFutureImpl<CResult> implements
AsyncRequestFuture {
@Override
public void waitUntilDone() throws InterruptedIOException {
try {
- waitUntilDone(Long.MAX_VALUE);
+ if (this.operationTimeout > 0) {
+ // the worker thread maybe over by some exception without decrement
the actionsInProgress,
+ // then the guarantee of operationTimeout will be broken, so we should
set cutoff to avoid
+ // stuck here forever
+ long cutoff = (EnvironmentEdgeManager.currentTime() +
this.operationTimeout) * 1000L;
+ waitUntilDone(cutoff);
+ } else {
+ waitUntilDone(Long.MAX_VALUE);
+ }
} catch (InterruptedException iex) {
throw new InterruptedIOException(iex.getMessage());
} finally {