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
This commit is contained in:
bsglz 2021-07-01 19:16:51 +08:00 committed by GitHub
parent 1381df4c80
commit 1d6eb77ef8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 1 deletions

View File

@ -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 {