From issues-return-84021-archive-asf-public=cust-asf.ponee.io@nifi.apache.org Tue Sep 3 14:24:05 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id CB2BD180637 for ; Tue, 3 Sep 2019 16:24:04 +0200 (CEST) Received: (qmail 48783 invoked by uid 500); 3 Sep 2019 16:28:20 -0000 Mailing-List: contact issues-help@nifi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@nifi.apache.org Delivered-To: mailing list issues@nifi.apache.org Received: (qmail 48773 invoked by uid 99); 3 Sep 2019 16:28:20 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Sep 2019 16:28:20 +0000 From: GitBox To: issues@nifi.apache.org Subject: =?utf-8?q?=5BGitHub=5D_=5Bnifi=5D_patricker_commented_on_a_change_in_pull?= =?utf-8?q?_request_=233673=3A_NIFI-6567_HandleHttpRequest_does_not_shutdo?= =?utf-8?q?wn_HTTP_server_in_some_cir=E2=80=A6?= Message-ID: <156752064412.12304.654528590299543104.gitbox@gitbox.apache.org> Date: Tue, 03 Sep 2019 14:24:04 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit 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