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/04 01:37:58 UTC

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

s9514171 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_r320541479
 
 

 ##########
 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:
   Thanks for your suggestion
   I have change the log level and keep the exception info

----------------------------------------------------------------
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