ableegoldman commented on a change in pull request #9978: URL: https://github.com/apache/kafka/pull/9978#discussion_r565802766
########## File path: streams/src/main/java/org/apache/kafka/streams/KafkaStreams.java ########## @@ -1208,24 +1227,28 @@ private Thread shutdownHelper(final boolean error) { } private boolean close(final long timeoutMs) { - if (state == State.ERROR) { - log.info("Streams client is already in the terminal state ERROR, all resources are closed and the client has stopped."); + if (state == State.ERROR || state == State.NOT_RUNNING) { Review comment: Something I noticed during testing, I feel it makes sense for the handling of ERROR and NOT_RUNNING to parallel (same for the PENDING_ flavors). This is a slight change in behavior; now if a user calls `close()` while the instance is already closing, it will wait for the ongoing shutdown to complete before returning (with timeout). ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org