szetszwo commented on a change in pull request #552:
URL: https://github.com/apache/ratis/pull/552#discussion_r761609329



##########
File path: 
ratis-netty/src/main/java/org/apache/ratis/netty/server/DataStreamManagement.java
##########
@@ -323,16 +323,16 @@ static void 
sendReply(List<CompletableFuture<DataStreamReply>> remoteWrites,
     ctx.writeAndFlush(builder.build());
   }
 
-  private CompletableFuture<Void> startTransaction(StreamInfo info, 
DataStreamRequestByteBuf request, long bytesWritten,
+  private void startTransaction(StreamInfo info, DataStreamRequestByteBuf 
request, long bytesWritten,

Review comment:
       Let's keep it async and sync it outside.
   ```
   +++ 
b/ratis-netty/src/main/java/org/apache/ratis/netty/server/DataStreamManagement.java
   @@ -409,7 +409,7 @@ public class DataStreamManagement {
              } else if (close) {
                if (info.isPrimary()) {
                  // after all server close stream, primary server start 
transaction
   -              startTransaction(info, request, bytesWritten, ctx);
   +              startTransaction(info, request, bytesWritten, ctx).join();
                } else {
                  sendReply(remoteWrites, request, bytesWritten, 
info.getCommitInfos(), ctx);
                }
   ```




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


Reply via email to