[
https://issues.apache.org/jira/browse/KAFKA-7345?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16593818#comment-16593818
]
John Roesler commented on KAFKA-7345:
-------------------------------------
Hi Ted,
I'm not familiar with the semantics of FileLock. Is it safe to assume the lock
was actually released if we get an IOException?
Thanks,
-John
> 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)