You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ratis.apache.org by GitBox <gi...@apache.org> on 2020/10/22 07:10:04 UTC

[GitHub] [incubator-ratis] amaliujia commented on a change in pull request #230: RATIS-1104.Should check "bytewritten" from remote writes to peers to determine whether current stream write is successful

amaliujia commented on a change in pull request #230:
URL: https://github.com/apache/incubator-ratis/pull/230#discussion_r509927843



##########
File path: ratis-netty/src/main/java/org/apache/ratis/netty/server/NettyServerStreamRpc.java
##########
@@ -199,25 +207,45 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) throws IOExceptio
           // do not need to forward header request
           final List<DataStreamOutput> outs = proxies.getDataStreamOutput();
           peersStreamOutput.put(request.getStreamId(), outs);
-          for(DataStreamOutput out : outs) {
+          for (DataStreamOutput out : outs) {
             remoteWrites.add(out.getHeaderFuture());
           }
         } else {
           // body
-          for(DataStreamOutput out : peersStreamOutput.get(request.getStreamId())) {
+          for (DataStreamOutput out : peersStreamOutput.get(request.getStreamId())) {
             remoteWrites.add(out.writeAsync(request.slice().nioBuffer()));
           }
         }
 
         JavaUtils.allOf(remoteWrites).thenCombine(localWrite, (v, bytesWritten) -> {
               buf.release();
-              sendReply(request, bytesWritten, ctx);

Review comment:
       I see. Updated.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org