divijvaidya commented on code in PR #12465:
URL: https://github.com/apache/kafka/pull/12465#discussion_r975301060
##########
streams/src/main/java/org/apache/kafka/streams/KafkaStreams.java:
##########
@@ -1096,7 +1096,7 @@ private Optional<String> removeStreamThread(final long
timeoutMs) throws Timeout
// make a copy of threads to avoid holding lock
for (final StreamThread streamThread : new
ArrayList<>(threads)) {
final boolean callingThreadIsNotCurrentStreamThread =
!streamThread.getName().equals(Thread.currentThread().getName());
- if (streamThread.isAlive() &&
(callingThreadIsNotCurrentStreamThread || getNumLiveStreamThreads() == 1)) {
Review Comment:
Note that `streamThread.isAlive()` is a `native` method and Mockito
currently does not support mocking of `native` methods.
I have made this change in logic to remove the check because even if the
thread is not running, we should remove it from data structures such as
`threads` and perform the clean up of the Java object. Hence, the check is not
really necessary.
@cadonna let me know if you have better ideas here.
--
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]