HBASE-3381 Interrupt of a region open comes across as a successful open; second attempt

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1052013 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2010-12-22 17:58:43 +00:00
parent 878c81346c
commit 8450cc6721
1 changed files with 13 additions and 3 deletions

View File

@ -158,10 +158,20 @@ public class OpenRegionHandler extends EventHandler {
}
// 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()) {
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.
return !t.interrupted() && t.getException() == null;