Sanjay Malakar created HBASE-30345:
--------------------------------------
Summary: Ensure FileIOEngine.shutdown() closes every backing file
Key: HBASE-30345
URL: https://issues.apache.org/jira/browse/HBASE-30345
Project: HBase
Issue Type: Bug
Components: BucketCache
Affects Versions: 2.6.7
Reporter: Sanjay Malakar
{{org.apache.hadoop.hbase.io.hfile.bucket.FileIOEngine.shutdown()}} closes the
\{{java.nio.channels.FileChannel}} and the \{{java.io.RandomAccessFile}} for
each backing file inside a single \{{try}} block. If
\{{java.nio.channels.FileChannel.close()}} throws \{{{}java.io.IOException{}}},
the matching \{{java.io.RandomAccessFile.close()}} is skipped and that file
handle is leaked. \{{shutdown()}} is also invoked from the \{{FileIOEngine}}
constructor's failure path, so a partially initialized engine leaks the same
way.
{\{org.apache.hadoop.hbase.io.hfile.bucket.FileIOEngine.shutdown()}} should
close each resource independently so that a failure closing one does not
prevent the attempt to close the other, keeping its current behaviour of
logging the \{{java.io.IOException}} rather than throwing it.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)