[ 
https://issues.apache.org/jira/browse/KAFKA-7345?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16593820#comment-16593820
 ] 

Ted Yu commented on KAFKA-7345:
-------------------------------

Replied on PR, copied below.
>From the javadoc of FileLock:
{code}
     * <p> If this lock object is valid then invoking this method releases the
     * lock and renders the object invalid.  If this lock object is invalid
     * then invoking this method has no effect.  </p>
{code}
It is not very clear how the potential IOException out of the method is related 
to the second part above.
My assumption is that an IOException implies that the ownership of the lock is 
no longer held.

> Potentially unclosed FileChannel in StateDirectory#unlock
> ---------------------------------------------------------
>
>                 Key: KAFKA-7345
>                 URL: https://issues.apache.org/jira/browse/KAFKA-7345
>             Project: Kafka
>          Issue Type: Bug
>          Components: streams
>            Reporter: Ted Yu
>            Priority: Minor
>         Attachments: KAFKA_7345.patch
>
>
> {code}
>             lockAndOwner.lock.release();
>             log.debug("{} Released state dir lock for task {}", logPrefix(), 
> taskId);
>             final FileChannel fileChannel = channels.remove(taskId);
>             if (fileChannel != null) {
>                 fileChannel.close();
> {code}
> If {{lockAndOwner.lock.release()}} throws IOE, the closing of the FileChannel 
> would be skipped.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to