mjsax commented on a change in pull request #8776: URL: https://github.com/apache/kafka/pull/8776#discussion_r434215315
########## File path: streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamTask.java ########## @@ -247,48 +251,75 @@ public void completeRestoration() { */ @Override public void prepareSuspend() { - if (state() == State.CREATED || state() == State.SUSPENDED) { - // do nothing - log.trace("Skip prepare suspending since state is {}", state()); - } else if (state() == State.RUNNING) { - closeTopology(true); + switch (state()) { Review comment: I think in general it's better to use `switch` and I never changed from `switch -> if/else` -- but did not update all methods either (if we only check for a single state, it seems overkill to use `switch`? ---------------------------------------------------------------- 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