hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1052013 - /hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRegionHandler.java
Date Wed, 22 Dec 2010 17:58:43 GMT
Author: stack
Date: Wed Dec 22 17:58:43 2010
New Revision: 1052013

URL: http://svn.apache.org/viewvc?rev=1052013&view=rev
Log:
HBASE-3381 Interrupt of a region open comes across as a successful open; second attempt

Modified:
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRegionHandler.java

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRegionHandler.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRegionHandler.java?rev=1052013&r1=1052012&r2=1052013&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRegionHandler.java
(original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRegionHandler.java
Wed Dec 22 17:58:43 2010
@@ -158,9 +158,19 @@ public class OpenRegionHandler extends E
     }
     // Is thread still alive?  We may have left above loop because server is
     // stopping or we timed out the edit.  Is so, interrupt it.
-    if (t.isAlive() && !signaller.get()) {
-      LOG.debug("Interrupting thread " + t);
-      t.interrupt();
+    if (t.isAlive()) {
+      if (!signaller.get()) {
+        // Thread still running; interrupt
+        LOG.debug("Interrupting thread " + t);
+        t.interrupt();
+      }
+      try {
+        t.join();
+      } catch (InterruptedException ie) {
+        LOG.warn("Interrupted joining " +
+          r.getRegionInfo().getRegionNameAsString(), ie);
+        Thread.currentThread().interrupt();
+      }
     }
     // Was there an exception opening the region?  This should trigger on
     // InterruptedException too.  If so, we failed.



Mime
View raw message