HBASE-12535 NPE in WALFactory under contention for getInstance()

Signed-off-by: stack <stack@apache.org>
This commit is contained in:
Sean Busbey 2014-11-19 14:23:00 -06:00 committed by stack
parent 05ced20a34
commit db2b6421ff
2 changed files with 10 additions and 1 deletions

View File

@ -187,7 +187,11 @@ public class WALFactory {
if (null != metaProvider) {
metaProvider.close();
}
provider.close();
// close is called on a WALFactory with null provider in the case of contention handling
// within the getInstance method.
if (null != provider) {
provider.close();
}
}
/**

View File

@ -152,6 +152,11 @@ public class TestWALFactory {
TEST_UTIL.shutdownMiniCluster();
}
@Test
public void canCloseSingleton() throws IOException {
WALFactory.getInstance(conf).close();
}
/**
* Just write multiple logs then split. Before fix for HADOOP-2283, this
* would fail.