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

ASF GitHub Bot updated HDFS-17978:
----------------------------------
    Labels: pull-request-available  (was: )

> Ensure requestShortCircuitFdsForRead() closes the block stream when 
> metadata-stream setup fails
> -----------------------------------------------------------------------------------------------
>
>                 Key: HDFS-17978
>                 URL: https://issues.apache.org/jira/browse/HDFS-17978
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: datanode
>    Affects Versions: 3.4.1
>            Reporter: Sanjay Malakar
>            Priority: Major
>              Labels: pull-request-available
>
> {\{org.apache.hadoop.hdfs.server.datanode.DataNode.requestShortCircuitFdsForRead()}}
>  opens the block data stream into \{{fis[0]}} before opening the metadata 
> stream into \{{fis[1]}}. \{{DatanodeUtil.getMetaDataInputStream()}} (and 
> \{{checkStorageState}} / \{{getBlockInputStream}}) can throw 
> \{{{}java.io.IOException{}}}. The catch clause handles only 
> \{{java.lang.ClassCastException}}, so the \{{java.io.IOException}} propagates 
> with \{{fis[0]}} already open. The \{{fis}} array is never returned on that 
> path, so \{{fis[0]}} is leaked.
> {\{requestShortCircuitFdsForRead()}} should close any stream already stored 
> in \{{fis}} before propagating the \{{java.io.IOException}}.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to