HDFS-17503. Unreleased volume references because of OOM. (#6782)

This commit is contained in:
Zilong Zhu 2024-05-10 10:34:40 +08:00 committed by GitHub
parent 43e8ca428e
commit 700b3e4800
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;
}
}