You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ratis.apache.org by GitBox <gi...@apache.org> on 2021/12/03 02:42:06 UTC

[GitHub] [ratis] szetszwo commented on a change in pull request #552: RATIS-1457. DataStreamManagement sync startTransaction

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: issues-unsubscribe@ratis.apache.org

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