From 9c7d9fa229ea97c288fc1f6843bb05a7a4df4b87 Mon Sep 17 00:00:00 2001 From: bsglz <18031031@qq.com> Date: Thu, 1 Jul 2021 19:16:51 +0800 Subject: [PATCH] =?UTF-8?q?HBASE-26027=20The=20calling=20of=20HTable.batch?= =?UTF-8?q?=20blocked=20at=20AsyncRequestFuture=E2=80=A6=20(#3419)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * HBASE-26027 The calling of HTable.batch blocked at AsyncRequestFutureImpl.waitUntilDone caused by ArrayStoreException (cherry picked from commit 1d6eb77ef8e813ce1050afe6d71954462ab0c28a) --- .../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 e46a50e76199..c26ebdcdfcb0 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 @@ -1148,7 +1148,15 @@ private String buildDetailedErrorMsg(String string, int index) { @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 {