mjsax commented on a change in pull request #10668:
URL: https://github.com/apache/kafka/pull/10668#discussion_r640126531



##########
File path: streams/src/test/java/org/apache/kafka/streams/KafkaStreamsTest.java
##########
@@ -491,25 +493,23 @@ public void testStateThreadClose() throws Exception {
                 () -> streams.localThreadsMetadata().stream().allMatch(t -> 
t.threadState().equals("DEAD")),
                 "Streams never stopped"
             );
-        } finally {
             streams.close();

Review comment:
       As `KafkaStreams` implements the `AutoCloseable` interface now, 
`close()` should be called automatically when the `try {}` block is left -- 
that is the whole purpose of `AutoClosable` and try-with-resource construct -- 
it frees you up to call `close()` explicitly (so you cannot forget any longer).




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