divijvaidya commented on code in PR #12465: URL: https://github.com/apache/kafka/pull/12465#discussion_r975301980
########## streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamThread.java: ########## @@ -1146,6 +1146,10 @@ private long advanceNowAndComputeLatency() { public void shutdown() { log.info("Informed to shut down"); final State oldState = setState(State.PENDING_SHUTDOWN); + + // If the thread is already shutting down, this is a No-op. + if (oldState == State.PENDING_SHUTDOWN || oldState == State.DEAD) return; Review Comment: I would like to piggy back this change with this commit. Happy to open a new PR too if you think that is required. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org