svn merge -c 1437775 FIXES: YARN-354. WebAppProxyServer exits immediately after startup. Contributed by Lian Xie

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1437776 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jason Darrell Lowe 2013-01-23 22:10:50 +00:00
parent eaf5cea54f
commit 1321717f60
3 changed files with 21 additions and 0 deletions

View File

@ -314,6 +314,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);