Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,17 @@
import java.nio.ByteBuffer;

import io.netty.buffer.Unpooled;
import io.netty.util.IllegalReferenceCountException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.apache.uniffle.common.netty.buffer.ManagedBuffer;
import org.apache.uniffle.common.netty.buffer.NettyManagedBuffer;
import org.apache.uniffle.common.util.ByteBufUtils;

public class ShuffleIndexResult {
private static final Logger LOG = LoggerFactory.getLogger(ShuffleIndexResult.class);

private final ManagedBuffer buffer;
private long dataFileLen;
private String dataFileName;
Expand Down Expand Up @@ -74,7 +79,16 @@ public boolean isEmpty() {

public void release() {
if (this.buffer != null) {
this.buffer.release();
try {
this.buffer.release();
} catch (IllegalReferenceCountException e) {
LOG.warn(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you log the Throwable e, too?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should catch specific exception class instead of Throwable.

"Failed to release shuffle index result with length {} of {}. "
+ "Maybe it has been released by others.",
dataFileLen,
dataFileName,
e);
}
}
}

Expand Down
Loading