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_r320299407
##########
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:
I think in this situation, we can make this a WARN level message. If it
fails to shutdown, and this node becomes the master again in the future, it
might fail to start.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services