When Jetty initializes fails, performing a shutdown sequence to ensure all allocated resources are released.
This closes
@@ -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);
}
