From a3144e93ad95a87cfb33d261c2f6eb67062734c1 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Thu, 30 Jun 2022 18:53:46 +0200 Subject: [PATCH] splitter: 1.0.0-vanilla-kafka - Fixed shutdown * The shutdown was blocked, because tSplitterStreamProcessor.stop() was called twice. * The second time, it could no longer reach the cluster, hence, blocking the shutdown process. --- .../kafka/wordcount/splitter/SplitterStreamProcessor.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/de/juplo/kafka/wordcount/splitter/SplitterStreamProcessor.java b/src/main/java/de/juplo/kafka/wordcount/splitter/SplitterStreamProcessor.java index fabae8f..0eafbda 100644 --- a/src/main/java/de/juplo/kafka/wordcount/splitter/SplitterStreamProcessor.java +++ b/src/main/java/de/juplo/kafka/wordcount/splitter/SplitterStreamProcessor.java @@ -254,6 +254,11 @@ public class SplitterStreamProcessor implements Runnable public void stop() { log.info("Shutdown requested..."); + if (stopped) + { + log.warn("Ignoring request: already stopped!"); + return; + } stopped = true; consumer.wakeup(); running.lock(); -- 2.20.1