You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2021/01/26 00:47:28 UTC
[GitHub] [hadoop] Nargeshdb commented on a change in pull request #2652: HDFS-15791. Possible Resource Leak in FSImageFormatProtobuf
Nargeshdb commented on a change in pull request #2652:
URL: https://github.com/apache/hadoop/pull/2652#discussion_r564139504
##########
File path: hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSImageFormatProtobuf.java
##########
@@ -269,14 +269,20 @@ public InputStream getInputStreamForSection(FileSummary.Section section,
String compressionCodec)
throws IOException {
FileInputStream fin = new FileInputStream(filename);
- FileChannel channel = fin.getChannel();
- channel.position(section.getOffset());
- InputStream in = new BufferedInputStream(new LimitInputStream(fin,
- section.getLength()));
+ try {
Review comment:
I don't think we can use try-with-resources here, since in the normal case, `in` gets returned, and it is a wrapper for `fin`.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org