You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2020/08/03 06:23:04 UTC

[GitHub] [kafka] highluck commented on a change in pull request #9105: MINOR: closable object Memory leak prevention

highluck commented on a change in pull request #9105:
URL: https://github.com/apache/kafka/pull/9105#discussion_r464215307



##########
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:
       thanks for review 
   It works, but it seems strange.
   The code was updated




----------------------------------------------------------------
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:
users@infra.apache.org