YARN-354. WebAppProxyServer exits immediately after startup. Contributed by Liang Xie

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1437775 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jason Darrell Lowe 2013-01-23 22:05:55 +00:00
parent a1e6df6bc4
commit 2e9e7601e1
3 changed files with 21 additions and 0 deletions

View File

@ -335,6 +335,9 @@ Release 0.23.6 - UNRELEASED
YARN-334. Maven RAT plugin is not checking all source files (tgraves)
YARN-354. WebAppProxyServer exits immediately after startup (Liang Xie via
jlowe)
Release 0.23.5 - 2012-11-28
INCOMPATIBLE CHANGES

View File

@ -114,4 +114,13 @@ public class WebAppProxy extends AbstractService {
}
super.stop();
}
public void join() {
if(proxyServer != null) {
try {
proxyServer.join();
} catch (InterruptedException e) {
}
}
}
}

View File

@ -73,6 +73,14 @@ public class WebAppProxyServer extends CompositeService {
YarnConfiguration.PROXY_PRINCIPAL);
}
/**
* Wait for service to finish.
* (Normally, it runs forever.)
*/
private void join() {
proxy.join();
}
public static void main(String[] args) {
Thread.setDefaultUncaughtExceptionHandler(new YarnUncaughtExceptionHandler());
StringUtils.startupShutdownMessage(WebAppProxyServer.class, args, LOG);
@ -84,6 +92,7 @@ public class WebAppProxyServer extends CompositeService {
YarnConfiguration conf = new YarnConfiguration();
proxy.init(conf);
proxy.start();
proxy.join();
} catch (Throwable t) {
LOG.fatal("Error starting Proxy server", t);
System.exit(-1);