vvcephei commented on a change in pull request #9697:
URL: https://github.com/apache/kafka/pull/9697#discussion_r539583538



##########
File path: streams/src/main/java/org/apache/kafka/streams/KafkaStreams.java
##########
@@ -444,6 +444,25 @@ private void handleStreamsUncaughtException(final 
Throwable throwable,
                     "The old handler will be ignored as long as a new handler 
is set.");
         }
         switch (action) {
+            case REPLACE_THREAD:
+                if (globalStreamThread != null && 
Thread.currentThread().getName().equals(globalStreamThread.getName())) {
+                    log.warn("The global thread cannot be replaced. Reverting 
to shutting down the client.");
+                    log.error("Encountered the following exception during 
processing " +
+                            "and the registered exception handler opted to " + 
action + "." +
+                            " The streams client is going to shut down now. ", 
throwable);
+                    close(Duration.ZERO);
+                }
+                final StreamThread deadThread = (StreamThread) 
threads.stream().filter(n -> 
n.getName().equals(Thread.currentThread().getName())).toArray()[0];

Review comment:
       Is this equivalent to `Thread.currentThead()`?




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to