cadonna commented on code in PR #12465:
URL: https://github.com/apache/kafka/pull/12465#discussion_r994922754


##########
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)) {
+                    if (callingThreadIsNotCurrentStreamThread || 
getNumLiveStreamThreads() == 1) {

Review Comment:
   @wcarlson5 Thanks for the info! Really useful! 
   
   > Instead of just removing the check you can maybe change to do something 
like
   > thread.state() == StreamThread.State.DEAD
   
   I guess you mean `thread.state() != StreamThread.State.DEAD && 
thread.state() != StreamThread.State.PENDING_SHUTDOWN`
   I think we also need to add `thread.state() != 
StreamThread.State.PENDING_SHUTDOWN` since stream threads in 
`StreamThread.State.PENDING_SHUTDOWN` are skipped in 
`getNumLiveStreamThreads()` and the result of that method is used to resize the 
cache. 
   
   I am not too much concerned about losing the ability to mock native methods. 
I think it is much more important to use a mocking framework that is actively 
maintained and does not block Java version upgrades in AK. As far as I 
understand that is the reason we move away from EasyMock and PowerMock to 
Mockito.



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

Reply via email to