HDFS-6678. MiniDFSCluster may still be partially running after initialization fails. Contributed by Chris Nauroth.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1610549 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Chris Nauroth 2014-07-14 22:49:08 +00:00
parent 3d9bea277a
commit 97b5fbc281
2 changed files with 74 additions and 63 deletions

View File

@ -303,6 +303,9 @@ Release 2.6.0 - UNRELEASED
HADOOP-8158. Interrupting hadoop fs -put from the command line HADOOP-8158. Interrupting hadoop fs -put from the command line
causes a LeaseExpiredException. (daryn via harsh) causes a LeaseExpiredException. (daryn via harsh)
HDFS-6678. MiniDFSCluster may still be partially running after initialization
fails. (cnauroth)
Release 2.5.0 - UNRELEASED Release 2.5.0 - UNRELEASED
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -663,6 +663,8 @@ private void initMiniDFSCluster(
boolean checkDataNodeHostConfig, boolean checkDataNodeHostConfig,
Configuration[] dnConfOverlays) Configuration[] dnConfOverlays)
throws IOException { throws IOException {
boolean success = false;
try {
ExitUtil.disableSystemExit(); ExitUtil.disableSystemExit();
synchronized (MiniDFSCluster.class) { synchronized (MiniDFSCluster.class) {
@ -730,6 +732,12 @@ private void initMiniDFSCluster(
waitClusterUp(); waitClusterUp();
//make sure ProxyUsers uses the latest conf //make sure ProxyUsers uses the latest conf
ProxyUsers.refreshSuperUserGroupsConfiguration(conf); ProxyUsers.refreshSuperUserGroupsConfiguration(conf);
success = true;
} finally {
if (!success) {
shutdown();
}
}
} }
/** /**