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 @@ -1499,7 +1499,6 @@ protected void sendError(ChannelHandlerContext ctx, HttpResponseStatus status) {
protected void sendError(ChannelHandlerContext ctx, String message, HttpResponseStatus status) {
FullHttpResponse response = new DefaultFullHttpResponse(HTTP_1_1, status);
sendError(ctx, message, response);
response.release();
}

protected void sendError(ChannelHandlerContext ctx, String message, FullHttpResponse response) {
Expand All @@ -1517,7 +1516,6 @@ private void sendFakeShuffleHeaderWithError(ChannelHandlerContext ctx, String me
header.write(out);

sendError(ctx, wrappedBuffer(out.getData(), 0, out.getLength()), fullResponse);
fullResponse.release();
}

protected void sendError(ChannelHandlerContext ctx, ByteBuf content,
Expand All @@ -1532,6 +1530,11 @@ protected void sendError(ChannelHandlerContext ctx, ByteBuf content,

// Close the connection as soon as the error message is sent.
ctx.channel().writeAndFlush(response).addListener(ChannelFutureListener.CLOSE);
/*
* The general rule of thumb is that the party that accesses a reference-counted object last
* is also responsible for the destruction of that reference-counted object.
*/
content.release();
}

@Override
Expand Down