From 84f48f87f8dcc0fc1f8b8670205653dc862276fd Mon Sep 17 00:00:00 2001 From: nkeywal Date: Tue, 4 Mar 2014 08:45:15 +0000 Subject: [PATCH] HBASE-10652 Fix incorrect handling of IE that restores current thread's interrupt status within while/for loops in rpc (Feng Honghua) git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1573937 13f79535-47bb-0310-9956-ffa450edef68 --- .../hadoop/hbase/ipc/SimpleRpcScheduler.java | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/SimpleRpcScheduler.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/SimpleRpcScheduler.java index 072960292b8..af7e6fb11b0 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/SimpleRpcScheduler.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/SimpleRpcScheduler.java @@ -154,11 +154,18 @@ public class SimpleRpcScheduler implements RpcScheduler { } private void consumerLoop(BlockingQueue myQueue) { - while (running) { - try { - CallRunner task = myQueue.take(); - task.run(); - } catch (InterruptedException e) { + boolean interrupted = false; + try { + while (running) { + try { + CallRunner task = myQueue.take(); + task.run(); + } catch (InterruptedException e) { + interrupted = true; + } + } + } finally { + if (interrupted) { Thread.currentThread().interrupt(); } }