From 625a079b73765d3cb28a90675a18ea15c9cc1f34 Mon Sep 17 00:00:00 2001 From: Jean-Daniel Cryans Date: Tue, 17 Aug 2010 18:44:35 +0000 Subject: [PATCH] HBASE-2923 Deadlock between HRegion.internalFlushCache and close git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@986448 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES.txt | 1 + .../java/org/apache/hadoop/hbase/regionserver/HRegion.java | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index fb706f9b7d0..f050d385211 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -478,6 +478,7 @@ Release 0.21.0 - Unreleased HBASE-2909 SoftValueSortedMap is broken, can generate NPEs HBASE-2919 initTableReducerJob: Unused method parameter (Libor Dener via Stack) + HBASE-2923 Deadlock between HRegion.internalFlushCache and close IMPROVEMENTS HBASE-1760 Cleanup TODOs in HTable diff --git a/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java b/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java index e47b8648e24..9fdd86d1ddf 100644 --- a/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java +++ b/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java @@ -470,7 +470,7 @@ public class HRegion implements HeapSize { // , Writable{ * * @throws IOException e */ - public synchronized List close(final boolean abort) + public List close(final boolean abort) throws IOException { if (isClosed()) { LOG.warn("Region " + this + " already closed"); @@ -507,6 +507,10 @@ public class HRegion implements HeapSize { // , Writable{ this.closing.set(true); try { splitsAndClosesLock.writeLock().lock(); + if (this.isClosed()) { + // SplitTransaction handles the null + return null; + } LOG.debug("Updates disabled for region, no outstanding scanners on " + this); try { // Write lock means no more row locks can be given out. Wait on