Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -624,21 +624,19 @@ public void shutdown() {

try {
this.join(workerShutdownTimeoutMS);
if (this.isAlive()) {
LOG.warn("CommitProcessor does not shutdown gracefully after "
+ "waiting for {} ms, exit to avoid potential "
+ "inconsistency issue", workerShutdownTimeoutMS);
System.exit(ExitCode.SHUTDOWN_UNGRACEFULLY.getValue());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Catch (InterruptedException) won't help for System.exit.

Maybe the best idea is to have a system property to disable the real 'System.exit' and add such property in tests (Maven surefire plugin config)

}

if (nextProcessor != null) {
nextProcessor.shutdown();
}
} catch (InterruptedException e) {
LOG.warn("Interrupted while waiting for CommitProcessor to finish");
Thread.currentThread().interrupt();
}

if (this.isAlive()) {
LOG.warn("CommitProcessor does not shutdown gracefully after "
+ "waiting for {} ms, exit to avoid potential "
+ "inconsistency issue", workerShutdownTimeoutMS);
System.exit(ExitCode.SHUTDOWN_UNGRACEFULLY.getValue());
}

if (nextProcessor != null) {
nextProcessor.shutdown();
}
}

}