You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@uniffle.apache.org by "roryqi (via GitHub)" <gi...@apache.org> on 2026/10/09 07:44:35 UTC
Re: [PR] [#2807] fix(spark): potential decompression failure for those skipped segments due to the released buffer [uniffle]
roryqi commented on code in PR #2808:
URL: https://github.com/apache/uniffle/pull/2808#discussion_r4227844644
##########
client/src/main/java/org/apache/uniffle/client/impl/DecompressionWorker.java:
##########
@@ -115,49 +115,44 @@ public void add(int batchIndex, ShuffleDataResult shuffleDataResult) {
for (BufferSegment bufferSegment : bufferSegments) {
CompletableFuture<ByteBuffer> f =
CompletableFuture.supplyAsync(
- () -> {
- try {
- if (segmentPermits.isPresent()) {
- segmentPermits.get().acquire();
- }
- } catch (InterruptedException e) {
- Thread.currentThread().interrupt();
- LOG.warn("Interrupted while acquiring segment permit", e);
- return null;
- }
-
- int offset = bufferSegment.getOffset();
- int length = bufferSegment.getLength();
- ByteBuffer buffer = sharedByteBuffer.duplicate();
- buffer.position(offset);
- buffer.limit(offset + length);
-
- int uncompressedLen = bufferSegment.getUncompressLength();
-
- long startBufferAllocation = System.currentTimeMillis();
- ByteBuffer dst =
- buffer.isDirect()
- ? ByteBuffer.allocateDirect(uncompressedLen)
- : ByteBuffer.allocate(uncompressedLen);
- decompressionBufferAllocationMillis.addAndGet(
- System.currentTimeMillis() - startBufferAllocation);
-
- long startDecompression = System.currentTimeMillis();
- codec.decompress(buffer, uncompressedLen, dst, 0);
- decompressionMillis.addAndGet(System.currentTimeMillis() - startDecompression);
- decompressionBytes.addAndGet(length);
-
- nowMemoryUsed.addAndGet(uncompressedLen);
- resetPeekMemoryUsed();
-
- return dst;
- },
- getOrCreateExecutor())
- .exceptionally(
- ex -> {
- LOG.error("Errors on decompressing shuffle block", ex);
- return null;
- });
+ () -> {
+ try {
+ if (segmentPermits.isPresent()) {
+ segmentPermits.get().acquire();
+ }
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ LOG.warn("Interrupted while acquiring segment permit", e);
+ return null;
Review Comment:
Is it ok to return null here?
Will it stop reading if we return null here?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org