liaoyuxiangqin created HDFS-13247:

             Summary: FileInputStream not closed when read the checksum header 
from the meta file
                 Key: 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.
DataChecksum checksum;
try (FileInputStream fis =
 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)];


This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

Reply via email to