You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-dev@hadoop.apache.org by "liaoyuxiangqin (JIRA)" <ji...@apache.org> on 2018/03/08 08:02:00 UTC

[jira] [Resolved] (HDFS-13247) FileInputStream not closed when read the checksum header from the meta file

     [ https://issues.apache.org/jira/browse/HDFS-13247?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

liaoyuxiangqin resolved HDFS-13247.
-----------------------------------
    Resolution: Not A Bug

> 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
>            Priority: Major
>
> 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