You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2019/09/03 14:24:04 UTC

[GitHub] [nifi] patricker commented on a change in pull request #3673: NIFI-6567 HandleHttpRequest does not shutdown HTTP server in some cir…

patricker commented on a change in pull request #3673: NIFI-6567 HandleHttpRequest does not shutdown HTTP server in some cir…
URL: https://github.com/apache/nifi/pull/3673#discussion_r320300329
 
 

 ##########
 File path: nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/HandleHttpRequest.java
 ##########
 @@ -537,10 +542,22 @@ public void shutdown() throws Exception {
             server.stop();
             server.destroy();
             server.join();
+            clearInit();
             getLogger().info("Shut down {}", new Object[]{server});
         }
     }
 
+    @OnPrimaryNodeStateChange
+    public void onPrimaryNodeChange(final PrimaryNodeState newState) {
+        if (runOnPrimary.get() && newState.equals(PrimaryNodeState.PRIMARY_NODE_REVOKED)) {
+            try {
+                shutdown();
+            } catch (final Exception shutdownException) {
+                getLogger().debug("Failed to shutdown following the Primary Node role revoked: " + shutdownException);
 
 Review comment:
   Also, small change suggestion, "Processor is configured to run only on Primary, but failed to shutdown HTTP server following revocation of primary node status."

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services