ableegoldman commented on a change in pull request #10215: URL: https://github.com/apache/kafka/pull/10215#discussion_r585220510
########## File path: streams/src/main/java/org/apache/kafka/streams/KafkaStreams.java ########## @@ -1047,9 +1047,15 @@ private int getNumStreamThreads(final boolean hasGlobalTopology) { if (!streamThread.waitOnThreadState(StreamThread.State.DEAD, timeoutMs - begin)) { log.warn("Thread " + streamThread.getName() + " did not shutdown in the allotted time"); timeout = true; + // Don't remove from threads until shutdown is complete. We will trim it from the + // list once it reaches DEAD, and if for some reason it's hanging indefinitely in the Review comment: We're trimming it in `getNextThreadIndex`. But if we're going to rely on `threads.size()` elsewhere, which it seems we do, then yeah we should trim it more aggressively ---------------------------------------------------------------- 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