From 2481b7f76fa7e4f2b120f8dc96004790b357e569 Mon Sep 17 00:00:00 2001 From: Andrew Purtell Date: Thu, 3 Sep 2015 17:48:45 -0700 Subject: [PATCH] HBASE-14359 HTable#close will hang forever if unchecked error/exception thrown in AsyncProcess#sendMultiAction (Victor Xu) --- .../hadoop/hbase/client/AsyncProcess.java | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) 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 0150a2e008a..96ed184e686 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 @@ -979,15 +979,20 @@ class AsyncProcess { } else { try { pool.submit(runnable); - } catch (RejectedExecutionException ree) { - // This should never happen. But as the pool is provided by the end user, let's secure - // this a little. + } catch (Throwable t) { + if (t instanceof RejectedExecutionException) { + // This should never happen. But as the pool is provided by the end user, + // let's secure this a little. + LOG.warn("#" + id + ", the task was rejected by the pool. This is unexpected." + + " Server is " + server.getServerName(), t); + } else { + // see #HBASE-14359 for more details + LOG.warn("Caught unexpected exception/error: ", t); + } decTaskCounters(multiAction.getRegions(), server); - LOG.warn("#" + id + ", the task was rejected by the pool. This is unexpected." + - " Server is " + server.getServerName(), ree); - // We're likely to fail again, but this will increment the attempt counter, so it will - // finish. - receiveGlobalFailure(multiAction, server, numAttempt, ree); + // We're likely to fail again, but this will increment the attempt counter, + // so it will finish. + receiveGlobalFailure(multiAction, server, numAttempt, t); } } }