Skip to content

Commit

Permalink
NIFI-10895 Handle minifi restarts more gracefully
Browse files Browse the repository at this point in the history
Signed-off-by: Csaba Bejan <bejan.csaba@gmail.com>

This closes #6852.
  • Loading branch information
ferencerdei authored and bejancsaba committed Jan 16, 2023
1 parent b7071cb commit 2abb892
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -305,11 +305,15 @@ private void acknowledgeHandler(String[] params) {
}

public void stop() {
bootstrapAcknowledgeExecutorService.shutdownNow();
heartbeatExecutorService.shutdown();
try {
heartbeatExecutorService.shutdown();
heartbeatExecutorService.awaitTermination(TERMINATION_WAIT, TimeUnit.MILLISECONDS);
if (!heartbeatExecutorService.awaitTermination(TERMINATION_WAIT, TimeUnit.MILLISECONDS)) {
heartbeatExecutorService.shutdownNow();
}
} catch (InterruptedException ignore) {
LOGGER.info("Stopping C2 Client's thread was interrupted but shutting down anyway the C2NifiClientService");
heartbeatExecutorService.shutdownNow();
}
}

Expand Down

0 comments on commit 2abb892

Please sign in to comment.