From 700b3e4800b074c94c2d48ed61cb0880fe3b408d Mon Sep 17 00:00:00 2001 From: Zilong Zhu Date: Fri, 10 May 2024 10:34:40 +0800 Subject: [PATCH] HDFS-17503. Unreleased volume references because of OOM. (#6782) --- .../org/apache/hadoop/hdfs/server/datanode/BlockSender.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockSender.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockSender.java index 5ac6ee9ccb..f7cec35b80 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockSender.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockSender.java @@ -434,12 +434,12 @@ class BlockSender implements java.io.Closeable { blockIn = datanode.data.getBlockInputStream(block, offset); // seek to offset ris = new ReplicaInputStreams( blockIn, checksumIn, volumeRef, fileIoProvider); - } catch (IOException ioe) { + } catch (Throwable t) { IOUtils.cleanupWithLogger(null, volumeRef); IOUtils.closeStream(this); IOUtils.closeStream(blockIn); IOUtils.closeStream(checksumIn); - throw ioe; + throw t; } }