mirror of https://github.com/apache/nifi.git
NIFI-10895 Handle minifi restarts more gracefully
Signed-off-by: Csaba Bejan <bejan.csaba@gmail.com> This closes #6852.
This commit is contained in:
parent
b7071cbb04
commit
2abb8921e7
|
@ -305,11 +305,15 @@ public class C2NifiClientService {
|
|||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue