[
https://issues.apache.org/jira/browse/ZOOKEEPER-5055?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
ASF GitHub Bot updated ZOOKEEPER-5055:
--------------------------------------
Labels: pull-request-available (was: )
> Ensure FileTxnLog.close() closes every stream
> ---------------------------------------------
>
> Key: ZOOKEEPER-5055
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-5055
> Project: ZooKeeper
> Issue Type: Bug
> Components: server
> Reporter: Sanjay Malakar
> Priority: Major
> Labels: pull-request-available
> Time Spent: 10m
> Remaining Estimate: 0h
>
> {{org.apache.zookeeper.server.persistence.FileTxnLog.close()}} closes
> {{logStream}} and the {{streamsToFlush}} queue sequentially. If any
> {{java.io.FileOutputStream.close()}} call throws {{{}java.io.IOException{}}},
> the method exits immediately and does not attempt to close the remaining file
> streams. This can leak file descriptors during transaction-log shutdown.
> {{org.apache.zookeeper.server.persistence.FileTxnLog.close()}} should attempt
> every close operation, preserve the first {{{}java.io.IOException{}}}, attach
> later failures as suppressed exceptions, and throw only after all streams
> have been attempted.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)