hadoop-hdfs-issues mailing list archives

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

    [ https://issues.apache.org/jira/browse/HDFS-13247?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16390888#comment-16390888
] 

liaoyuxiangqin commented on HDFS-13247:
---------------------------------------

[~jzhuge] Thanks for you advise on this!

> 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-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org


Mime
View raw message