HDFS-8043. NPE in MiniDFSCluster teardown. Contributed by Brahma Reddy Battula.

This commit is contained in:
Tsuyoshi Ozawa 2015-04-19 18:19:36 +09:00
parent 5112477d9e
commit 5459b241c8
3 changed files with 10 additions and 3 deletions

View File

@ -520,6 +520,8 @@ Release 2.8.0 - UNRELEASED
HDFS-7863. Missing description of some methods and parameters in javadoc of HDFS-7863. Missing description of some methods and parameters in javadoc of
FSDirDeleteOp. (Brahma Reddy Battula via ozawa) FSDirDeleteOp. (Brahma Reddy Battula via ozawa)
HDFS-8043. NPE in MiniDFSCluster teardown. (Brahma Reddy Battula via ozawa)
Release 2.7.1 - UNRELEASED Release 2.7.1 - UNRELEASED
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -1744,6 +1744,7 @@ public class MiniDFSCluster {
nameNode = null; nameNode = null;
} }
} }
if (base_dir != null) {
if (deleteDfsDir) { if (deleteDfsDir) {
base_dir.delete(); base_dir.delete();
} else { } else {
@ -1751,6 +1752,8 @@ public class MiniDFSCluster {
} }
} }
}
/** /**
* Shutdown all DataNodes started by this class. The NameNode * Shutdown all DataNodes started by this class. The NameNode
* is left running so that new DataNodes may be started. * is left running so that new DataNodes may be started.

View File

@ -85,8 +85,10 @@ public class TestDFSClientFailover {
@After @After
public void tearDownCluster() throws IOException { public void tearDownCluster() throws IOException {
if (cluster != null) {
cluster.shutdown(); cluster.shutdown();
} }
}
@After @After
public void clearConfig() { public void clearConfig() {