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 "Sanjay Malakar (Jira)" <ji...@apache.org> on 2026/09/08 23:20:00 UTC
[jira] [Created] (HDFS-17978) Ensure requestShortCircuitFdsForRead() closes the block stream when metadata-stream setup fails
Sanjay Malakar created HDFS-17978:
-------------------------------------
Summary: 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
{\{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: hdfs-dev-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-dev-help@hadoop.apache.org