abbccdda commented on a change in pull request #8833:
URL: https://github.com/apache/kafka/pull/8833#discussion_r438399384



##########
File path: 
streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamTask.java
##########
@@ -506,19 +455,18 @@ public void update(final Set<TopicPartition> 
topicPartitions, final ProcessorTop
 
     @Override
     public void closeAndRecycleState() {
-        prepareClose(true);
-
+        suspendCleanAndPrepareCommit();
         writeCheckpointIfNeed();
 
         switch (state()) {
             case CREATED:
-            case RUNNING:
-            case RESTORING:
             case SUSPENDED:
                 stateMgr.recycle();
                 recordCollector.close();
                 break;
 
+            case RESTORING: // we should have transitioned to `SUSPENDED` 
already

Review comment:
       That makes sense




----------------------------------------------------------------
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:
[email protected]


Reply via email to