mirror of https://github.com/apache/nifi.git
NIFI-2626 Fixes jetty server thread leak. This closes #910
This commit is contained in:
parent
7123a1a276
commit
dca3764ed1
|
@ -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()));
|
||||
}
|
||||
server.start();
|
||||
try {
|
||||
server.start();
|
||||
} catch (Exception e) {
|
||||
shutdownHttpServer(server);
|
||||
throw e;
|
||||
}
|
||||
|
||||
this.server = server;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue