Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#1628] test(client): Fix double release ShuffleIndexResult cause exception to pass flaky test #2179

Merged
merged 3 commits into from
Oct 18, 2024
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