runzhiwang commented on a change in pull request #231:
URL: https://github.com/apache/incubator-ratis/pull/231#discussion_r511210979



##########
File path: 
ratis-netty/src/main/java/org/apache/ratis/netty/server/NettyServerStreamRpc.java
##########
@@ -234,7 +236,8 @@ public void channelRead(ChannelHandlerContext ctx, Object 
msg) throws IOExceptio
           }
         }
 
-        JavaUtils.allOf(remoteWrites).thenCombine(localWrite, (v, 
bytesWritten) -> {
+        previous = previous.thenCombine(JavaUtils.allOf(remoteWrites), (u, v) 
-> null)
+            .thenCombine(localWrite, (v, bytesWritten) -> {

Review comment:
       @szetszwo Because the slow previous will slow down the following 
request. So I am considering another fix: Use Map instead of queue for the 
[replies](https://github.com/apache/incubator-ratis/blob/master/ratis-netty/src/main/java/org/apache/ratis/netty/client/NettyClientStreamRpc.java#L46).
 If we use queue, when send request1, request2, but response reply2, reply1, 
when client receive reply2 it will complete request1, which should complete 
request2,  then error happen. If we use Map instead of queue, we do not need to 
wait the previous.




----------------------------------------------------------------
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:
[email protected]


Reply via email to