You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by nk...@apache.org on 2014/03/04 09:45:16 UTC

svn commit: r1573937 - /hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/SimpleRpcScheduler.java

Author: nkeywal
Date: Tue Mar  4 08:45:15 2014
New Revision: 1573937

URL: http://svn.apache.org/r1573937
Log:
HBASE-10652 Fix incorrect handling of IE that restores current thread's interrupt status within while/for loops in rpc (Feng Honghua)

Modified:
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/SimpleRpcScheduler.java

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/SimpleRpcScheduler.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/SimpleRpcScheduler.java?rev=1573937&r1=1573936&r2=1573937&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/SimpleRpcScheduler.java (original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/SimpleRpcScheduler.java Tue Mar  4 08:45:15 2014
@@ -154,11 +154,18 @@ public class SimpleRpcScheduler implemen
   }
 
   private void consumerLoop(BlockingQueue<CallRunner> 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();
       }
     }