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



##########
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:
       My point is that if the transition from a different state than 
`PENDING_SHUTDOWN` is illegal then we will never reach the `log.error()` on 
line 664 since [this 
check](https://github.com/apache/kafka/blob/c1071327c50613ae8647f1fa98f00f78a0cb5d76/streams/src/main/java/org/apache/kafka/streams/processor/internals/GlobalStreamThread.java#L163)
 will throw an exception before.




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