mjsax commented on a change in pull request #11455:
URL: https://github.com/apache/kafka/pull/11455#discussion_r750806826



##########
File path: streams/src/main/java/org/apache/kafka/streams/KafkaStreams.java
##########
@@ -655,10 +656,11 @@ public synchronized void onChange(final Thread thread,
                     // global stream thread has different invariants
                     final GlobalStreamThread.State newState = 
(GlobalStreamThread.State) abstractNewState;
                     globalThreadState = newState;
+                    final GlobalStreamThread.State oldState = 
(GlobalStreamThread.State) abstractOldState;
 
                     if (newState == GlobalStreamThread.State.RUNNING) {
                         maybeSetRunning();
-                    } else if (newState == GlobalStreamThread.State.DEAD) {
+                    } else if (newState == GlobalStreamThread.State.DEAD && 
oldState != GlobalStreamThread.State.PENDING_SHUTDOWN) {

Review comment:
       Not sure what you are trying to say? Can you clarify?
   
   I agree that we always need to be in `PENDING_SHUTDOWN` to be able to 
transit to `DEAD`. That's why it would be an error the we should log.
   
   Not sure if you agree to the propose code change or not?




-- 
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


Reply via email to