YARN-4313. Race condition in MiniMRYarnCluster when getting history

server address. Contributed by Jian He

(cherry picked from commit 7412ff48eeb967c972c19c1370c77a41c5b3b81f)
(cherry picked from commit b505bf9e582f5bca59be28296a4b4a640b3389eb)
This commit is contained in:
Xuan 2015-10-29 17:36:36 -07:00
parent 3287a50cfe
commit ceefabc44a
2 changed files with 7 additions and 1 deletions

View File

@ -190,6 +190,7 @@ private class JobHistoryServerWrapper extends AbstractService {
public JobHistoryServerWrapper() {
super(JobHistoryServerWrapper.class.getName());
}
private volatile boolean jhsStarted = false;
@Override
public synchronized void serviceStart() throws Exception {
@ -211,9 +212,11 @@ public synchronized void serviceStart() throws Exception {
new Thread() {
public void run() {
historyServer.start();
jhsStarted = true;
};
}.start();
while (historyServer.getServiceState() == STATE.INITED) {
while (!jhsStarted) {
LOG.info("Waiting for HistoryServer to start...");
Thread.sleep(1500);
}

View File

@ -100,6 +100,9 @@ Release 2.7.2 - UNRELEASED
YARN-4183. Enabling generic application history forces every job to get a
timeline service delegation token (Mit Desai via jeagles)
YARN-4313. Race condition in MiniMRYarnCluster when getting history server
address. (Jian He via xgong)
Release 2.7.1 - 2015-07-06
INCOMPATIBLE CHANGES