YARN-2606. Application History Server tries to access hdfs before doing secure login (Mit Desai via jeagles)

This commit is contained in:
Jonathan Eagles 2014-09-29 16:40:46 -05:00
parent 38f3b11c29
commit 9bc676aa6e
3 changed files with 10 additions and 6 deletions

View File

@ -435,6 +435,9 @@ Release 2.6.0 - UNRELEASED
YARN-2608. FairScheduler: Potential deadlocks in loading alloc files and YARN-2608. FairScheduler: Potential deadlocks in loading alloc files and
clock access. (Wei Yan via kasha) clock access. (Wei Yan via kasha)
YARN-2606. Application History Server tries to access hdfs before doing
secure login (Mit Desai via jeagles)
Release 2.5.1 - 2014-09-05 Release 2.5.1 - 2014-09-05
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -115,7 +115,8 @@ public class FileSystemApplicationHistoryStore extends AbstractService
} }
@Override @Override
public void serviceInit(Configuration conf) throws Exception { public void serviceStart() throws Exception {
Configuration conf = getConfig();
Path fsWorkingPath = Path fsWorkingPath =
new Path(conf.get(YarnConfiguration.FS_APPLICATION_HISTORY_STORE_URI, new Path(conf.get(YarnConfiguration.FS_APPLICATION_HISTORY_STORE_URI,
conf.get("hadoop.tmp.dir") + "/yarn/timeline/generic-history")); conf.get("hadoop.tmp.dir") + "/yarn/timeline/generic-history"));
@ -132,7 +133,7 @@ public class FileSystemApplicationHistoryStore extends AbstractService
LOG.error("Error when initializing FileSystemHistoryStorage", e); LOG.error("Error when initializing FileSystemHistoryStorage", e);
throw e; throw e;
} }
super.serviceInit(conf); super.serviceStart();
} }
@Override @Override

View File

@ -61,10 +61,10 @@ public class TestFileSystemApplicationHistoryStore extends
@Before @Before
public void setup() throws Exception { public void setup() throws Exception {
fs = new RawLocalFileSystem(); fs = new RawLocalFileSystem();
initStore(fs); initAndStartStore(fs);
} }
private void initStore(final FileSystem fs) throws IOException, private void initAndStartStore(final FileSystem fs) throws IOException,
URISyntaxException { URISyntaxException {
Configuration conf = new Configuration(); Configuration conf = new Configuration();
fs.initialize(new URI("/"), conf); fs.initialize(new URI("/"), conf);
@ -272,7 +272,7 @@ public class TestFileSystemApplicationHistoryStore extends
doReturn(true).when(fs).isDirectory(any(Path.class)); doReturn(true).when(fs).isDirectory(any(Path.class));
try { try {
initStore(fs); initAndStartStore(fs);
} catch (Exception e) { } catch (Exception e) {
Assert.fail("Exception should not be thrown: " + e); Assert.fail("Exception should not be thrown: " + e);
} }
@ -293,7 +293,7 @@ public class TestFileSystemApplicationHistoryStore extends
doThrow(new IOException()).when(fs).mkdirs(any(Path.class)); doThrow(new IOException()).when(fs).mkdirs(any(Path.class));
try { try {
initStore(fs); initAndStartStore(fs);
Assert.fail("Exception should have been thrown"); Assert.fail("Exception should have been thrown");
} catch (Exception e) { } catch (Exception e) {
// Expected failure // Expected failure