hadoop-hdfs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "liaoyuxiangqin (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HDFS-13247) FileInputStream not closed when read the checksum header from the meta file
Date Thu, 08 Mar 2018 07:33:00 GMT
liaoyuxiangqin created HDFS-13247:
-------------------------------------

             Summary: FileInputStream not closed when read the checksum header from the meta
file
                 Key: HDFS-13247
                 URL: https://issues.apache.org/jira/browse/HDFS-13247
             Project: Hadoop HDFS
          Issue Type: Bug
          Components: datanode
    Affects Versions: 3.2.0
            Reporter: liaoyuxiangqin


When i read the computeChecksum() of FsDatasetImpl class in datanode, I found the following
code not closed fis after  read the checksum header from the meta file, According to the
comments of function readDataChecksum()  we must close inputStream  by the caller. Thanks.
{code:java|title=FsDatasetImpl.java|borderStyle=solid}
DataChecksum checksum;
try (FileInputStream fis =
 srcReplica.getFileIoProvider().getFileInputStream(
 srcReplica.getVolume(), srcMeta)) {
 checksum = BlockMetadataHeader.readDataChecksum(
 fis, DFSUtilClient.getIoFileBufferSize(conf), srcMeta);
}

final byte[] data = new byte[1 << 16];
final byte[] crcs = new byte[checksum.getChecksumSize(data.length)];

{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-dev-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-dev-help@hadoop.apache.org


Mime
View raw message