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



##########
File path: streams/src/main/java/org/apache/kafka/streams/KafkaStreams.java
##########
@@ -444,6 +444,18 @@ 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:
+                StreamThread deadThread = (StreamThread) 
threads.stream().filter(n -> 
n.getName().equals(Thread.currentThread().getName())).toArray()[0];
+                threads.remove(deadThread);

Review comment:
       It won't matter. Ensures is too strong of a word. IF there has been 
other threads removed before this it may have a different name. However this 
ensures that the replacement thread will never have a thread index larger than 
the number of threads




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