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/11/23 21:54:34 UTC

[GitHub] [incubator-ratis] amaliujia commented on a change in pull request #281: RATIS-1160. DataStreamClientImpl.closeAsync() should be idempotent.

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



##########
File path: ratis-client/src/main/java/org/apache/ratis/client/impl/DataStreamClientImpl.java
##########
@@ -81,14 +86,22 @@ private DataStreamOutputImpl(RaftClientRequest request) {
     // send to the attached dataStreamClientRpc
     @Override
     public CompletableFuture<DataStreamReply> writeAsync(ByteBuffer buf) {
+      if (isClosed()) {
+        return JavaUtils.completeExceptionally(new AlreadyClosedException(
+            clientId + ": stream already closed, request=" + header));

Review comment:
       +1 this is a good point!




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