abbccdda commented on a change in pull request #9105: URL: https://github.com/apache/kafka/pull/9105#discussion_r463708981
########## File path: streams/src/main/java/org/apache/kafka/streams/processor/internals/StateDirectory.java ########## @@ -197,8 +197,8 @@ synchronized boolean lock(final TaskId taskId) throws IOException { final FileChannel channel; - try { - channel = getOrCreateFileChannel(taskId, lockFile.toPath()); + try (final FileChannel fileChannel = getOrCreateFileChannel(taskId, lockFile.toPath())) { Review comment: It looks weird to use the resource outside of try block, does this really work? ---------------------------------------------------------------- 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