mirror of
https://github.com/apache/nifi.git
synced 2025-02-09 03:25:04 +00:00
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…
x
Reference in New Issue
Block a user