guohao-rosicky commented on a change in pull request #571:
URL: https://github.com/apache/ratis/pull/571#discussion_r776556351
##########
File path:
ratis-netty/src/main/java/org/apache/ratis/netty/client/NettyClientStreamRpc.java
##########
@@ -158,9 +196,18 @@ public void channelRead(ChannelHandlerContext ctx, Object
msg) {
clientInvocationId = ClientInvocationId.valueOf(reply.getClientId(),
reply.getStreamId());
final ReplyQueue queue = replies.get(clientInvocationId);
if (queue != null) {
- final CompletableFuture<DataStreamReply> f = queue.poll();
+ final DataStreamRequestEntry f = queue.poll();
if (f != null) {
- f.complete(reply);
+ f.getReplyFuture().complete(reply);
+
+ if (!reply.isSuccess() && queue.size() > 0) {
+ replies.remove(clientInvocationId).forEach(cf -> {
+ if (!cf.getReplyFuture().isDone()) {
+ cf.getReplyFuture().complete(cf.getErrorDataStreamReply());
+ }
+ });
+ }
Review comment:
@szetszwo Has been modified, please take a look.
--
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]