iamsanjaymalakar opened a new pull request, #8582:
URL: https://github.com/apache/hbase/pull/8582

   ### Problem
   
   `org.apache.hadoop.hbase.io.hfile.bucket.FileIOEngine.shutdown()` closed 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()` threw `java.io.IOException`, the 
matching `java.io.RandomAccessFile.close()` was skipped and that file handle 
was leaked. `shutdown()` also runs from the `FileIOEngine` constructor's 
failure path, so a partially initialized engine leaked the same way.
   
   ### Change
   
   * Close the `FileChannel` and the `RandomAccessFile` for each backing file 
independently.
   * A failure closing one no longer prevents the attempt to close the other.
   * `shutdown()` keeps logging the `java.io.IOException` at `ERROR` rather 
than throwing it.
   
   ### Testing
   
   * `mvn -pl hbase-server -am -Dtest=TestFileIOEngine test`
   * `mvn -pl hbase-server -am spotless:check`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to