DBZ-7661 Always shut down record processing thread pool

This commit is contained in:
Vojtech Juranek 2024-03-18 22:15:37 +01:00 committed by Jiri Pechanec
parent e49c9d5150
commit 16a089abb6

View File

@ -540,10 +540,13 @@ private void stopRecordService() {
LOGGER.debug("Stopping records service.");
final long shutdownTimeout = config.getLong(AsyncEngineConfig.RECORD_PROCESSING_SHUTDOWN_TIMEOUT_MS);
try {
recordService.shutdown();
recordService.awaitTermination(shutdownTimeout, TimeUnit.MILLISECONDS);
}
catch (InterruptedException e) {
LOGGER.info("Timed out while waiting for record service shutdown. Shutting it down immediately.");
}
finally {
recordService.shutdownNow();
}
}