Skip to content

Commit 28340ef

Browse files
author
Davies Liu
committed
fix tests
1 parent b3e1786 commit 28340ef

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

core/src/main/scala/org/apache/spark/storage/ShuffleBlockFetcherIterator.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,7 @@ final class ShuffleBlockFetcherIterator(
356356
// Only copy the stream if it's wrapped by compression or encryption, also the size of
357357
// block is small (the decompressed block is smaller than maxBytesInFlight)
358358
if (detectCorrupt && !input.eq(in) && size < maxBytesInFlight / 3) {
359+
val originalInput = input
359360
val out = new ChunkedByteBufferOutputStream(64 * 1024, ByteBuffer.allocate)
360361
try {
361362
// Decompress the whole block at once to detect any corruption, which could increase
@@ -378,7 +379,7 @@ final class ShuffleBlockFetcherIterator(
378379
}
379380
} finally {
380381
// TODO: release the buf here to free memory earlier
381-
input.close()
382+
originalInput.close()
382383
in.close()
383384
}
384385
}

0 commit comments

Comments
 (0)