NIFI-2626 Fixes jetty server thread leak. This closes #910

This commit is contained in:
Jeff Storck 2016-08-22 14:48:06 -04:00 committed by Matt Gilman
parent 7123a1a276
commit dca3764ed1
1 changed files with 10 additions and 1 deletions

View File

@ -182,6 +182,10 @@ public class ListenHTTP extends AbstractSessionFactoryProcessor {
return;
}
shutdownHttpServer(toShutdown);
}
private void shutdownHttpServer(Server toShutdown) {
try {
toShutdown.stop();
toShutdown.destroy();
@ -276,7 +280,12 @@ public class ListenHTTP extends AbstractSessionFactoryProcessor {
if (context.getProperty(HEADERS_AS_ATTRIBUTES_REGEX).isSet()) {
contextHandler.setAttribute(CONTEXT_ATTRIBUTE_HEADER_PATTERN, Pattern.compile(context.getProperty(HEADERS_AS_ATTRIBUTES_REGEX).getValue()));
}
try {
server.start();
} catch (Exception e) {
shutdownHttpServer(server);
throw e;
}
this.server = server;
}