Skip to content

Commit

Permalink
[core] fix the issue that BinaryExternalMerger spill files may be lea…
Browse files Browse the repository at this point in the history
…ked. (apache#3975)
  • Loading branch information
liming30 authored Aug 16, 2024
1 parent b7939c3 commit 018341e
Showing 1 changed file with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ private ChannelWithMeta mergeChannels(List<ChannelWithMeta> channelIDs) throws I
channelManager.addChannel(mergedChannelID);
ChannelWriterOutputView output = null;

int numBytesInLastBlock;
int numBlocksWritten;
try {
output =
Expand All @@ -191,14 +190,14 @@ private ChannelWithMeta mergeChannels(List<ChannelWithMeta> channelIDs) throws I
output.getChannel().deleteChannel();
}
throw e;
}

// remove, close and delete channels
for (FileIOChannel channel : openChannels) {
channelManager.removeChannel(channel.getChannelID());
try {
channel.closeAndDelete();
} catch (Throwable ignored) {
} finally {
// remove, close and delete channels
for (FileIOChannel channel : openChannels) {
channelManager.removeChannel(channel.getChannelID());
try {
channel.closeAndDelete();
} catch (Throwable ignored) {
}
}
}

Expand Down

0 comments on commit 018341e

Please sign in to comment.