[
https://issues.apache.org/jira/browse/ZOOKEEPER-1890?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13931183#comment-13931183
]
Dutch T. Meyer commented on ZOOKEEPER-1890:
-------------------------------------------
I appreciate this patch, but I see a problem.
In SyncRequestProcessor.java::run()
After zks.getZKDatabase().rollLog(), the request being processed will be added
to the toFlush list at the bottom of the loop.
At the top of the loop, toFlush will then be non-empty. So we go into the else
block, where queuedRequests.poll() can return null if there are no more waiting
requests. In that case we will try to flush. However, because we closed the
fos associated with the request the flush can fail with a
ClosedChannelException.
Can we just catch and ignore the ClosedChannelException?
> unclosed FileOutputStream in FileTxnLog.rollLog
> -----------------------------------------------
>
> Key: ZOOKEEPER-1890
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1890
> Project: ZooKeeper
> Issue Type: Bug
> Reporter: Andrew Gaul
> Attachments: zookeeper-1890.patch
>
>
> When calling rollLog, FileTxnLog flushes but does not close its
> FileOutputStream, leaking a file descriptor.
--
This message was sent by Atlassian JIRA
(v6.2#6252)