mjsax commented on code in PR #18765:
URL: https://github.com/apache/kafka/pull/18765#discussion_r1938064632


##########
streams/src/main/java/org/apache/kafka/streams/KafkaStreams.java:
##########
@@ -347,8 +347,9 @@ private boolean setState(final State newState) {
             } else if (state == State.REBALANCING && newState == 
State.REBALANCING) {
                 // when the state is already in REBALANCING, it should not 
transit to REBALANCING again
                 return false;
-            } else if (state == State.ERROR && (newState == 
State.PENDING_ERROR || newState == State.ERROR)) {
-                // when the state is already in ERROR, its transition to 
PENDING_ERROR or ERROR (due to consecutive close calls)
+            } else if (state == State.ERROR && (newState == 
State.PENDING_ERROR || newState == State.ERROR || newState == 
State.PENDING_SHUTDOWN)) {

Review Comment:
   > We need transitions of all shutdown states (PENDING_SHUTDOWN, NOT_RUNNING, 
ERROR, PENDING_ERROR) to PENDING_SHUTDOWN to be non-fatal (rejecting transition 
but not throwing)
   
   For this case, we only covered `PENDING_SHUTDOWN -> PENDING_SHUTDOWN` so far 
(very first check). This PR currently adds `ERROR -> PENDING_SHUTDOWN`.
   
   We would still miss `PENDING_ERROR -> PENDING_SHUTDOWN` below, as well as 
`NOT_RUNNING -> PENDING_SHUTDOWN` above?



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