mjsax commented on a change in pull request #11455:
URL: https://github.com/apache/kafka/pull/11455#discussion_r750808720
##########
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) {
log.error("Global thread has died. The streams
application or client will now close to ERROR.");
closeToError();
Review comment:
Why? The uncaught exception handler is user code and cannot set the
client state;`closeToError()` is an internal method the user cannot call.
But thinking about it, it seem we are missing a call to `closeToError()`
with `GlobalStreamThread#run()` exception handling blocks?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]