Skip to content

Commit

Permalink
RATIS-2199. Release once on exception
Browse files Browse the repository at this point in the history
  • Loading branch information
symious committed Nov 25, 2024
1 parent 04396ca commit 8e6a331
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -476,13 +476,17 @@ private void readImpl(DataStreamRequestByteBuf request, ChannelHandlerContext ct
}
return null;
}, requestExecutor)).whenComplete((v, exception) -> {
boolean released = false;
try {
if (exception != null) {
replyDataStreamException(server, exception, info.getRequest(), request, ctx);
removeDataStream(key, info);
released = true;
}
} finally {
request.release();
if (!released) {
request.release();
}
channels.remove(channelId, key);
}
});
Expand Down

0 comments on commit 8e6a331

Please sign in to comment.