szetszwo commented on code in PR #955:
URL: https://github.com/apache/ratis/pull/955#discussion_r1377017070
##########
ratis-netty/src/main/java/org/apache/ratis/netty/server/DataStreamManagement.java:
##########
@@ -326,9 +326,11 @@ static long writeTo(ByteBuf buf, Iterable<WriteOption>
options,
for (ByteBuffer buffer : buf.nioBuffers()) {
final ReferenceCountedObject<ByteBuffer> wrapped =
ReferenceCountedObject.wrap(buffer, buf::retain, buf::release);
try {
- byteWritten += channel.write(wrapped);
+ byteWritten += channel.write(wrapped.retain());
Review Comment:
@ivandika3 , we need to pass `ReferenceCountedObject` instead of
`ByteBuffer` so that the implementation can also retain the buffer for later
use.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]