HBASE-12535 NPE in WALFactory under contention for getInstance()
Signed-off-by: stack <stack@apache.org>
This commit is contained in:
parent
05ced20a34
commit
db2b6421ff
|
@ -187,8 +187,12 @@ public class WALFactory {
|
|||
if (null != metaProvider) {
|
||||
metaProvider.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();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Tell the underlying WAL providers to shut down, but do not clean up underlying storage.
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue