Repository: nifi
Updated Branches:
  refs/heads/master e9af6c6ad -> f3013d076


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 <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/f3013d07
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/f3013d07
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/f3013d07

Branch: refs/heads/master
Commit: f3013d0764202dfb936231eceecc64f40540e0c3
Parents: e9af6c6
Author: Matt Gilman <[email protected]>
Authored: Wed Feb 7 13:52:02 2018 -0500
Committer: Bryan Bende <[email protected]>
Committed: Wed Feb 7 16:40:23 2018 -0500

----------------------------------------------------------------------
 .../nifi/processors/standard/HandleHttpRequest.java       | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/nifi/blob/f3013d07/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/HandleHttpRequest.java
----------------------------------------------------------------------
diff --git 
a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/HandleHttpRequest.java
 
b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/HandleHttpRequest.java
index 5f17156..d436312 100644
--- 
a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/HandleHttpRequest.java
+++ 
b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/HandleHttpRequest.java
@@ -485,7 +485,15 @@ public class HandleHttpRequest extends AbstractProcessor {
             }
         } catch (Exception e) {
             context.yield();
-            throw new ProcessException("Failed to initialize the server",e);
+
+            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);
         }
 
         HttpRequestContainer container;

Reply via email to