NIFI-4837:

- When Jetty initializes fails, performing a shutdown sequence to ensure all allocated resources are released.

This closes #2455.

Signed-off-by: Bryan Bende <bbende@apache.org>
This commit is contained in:
Matt Gilman 2018-02-07 13:52:02 -05:00 committed by Bryan Bende
parent e9af6c6ad8
commit f3013d0764
No known key found for this signature in database
GPG Key ID: A0DDA9ED50711C39
1 changed files with 9 additions and 1 deletions

View File

@ -485,6 +485,14 @@ public class HandleHttpRequest extends AbstractProcessor {
}
} catch (Exception e) {
context.yield();
try {
// shutdown to release any resources allocated during the failed initialization
shutdown();
} catch (final Exception shutdownException) {
getLogger().debug("Failed to shutdown following a failed initialization: " + shutdownException);
}
throw new ProcessException("Failed to initialize the server", e);
}