szetszwo commented on PR #1359:
URL: https://github.com/apache/ratis/pull/1359#issuecomment-3955037734

   When the callId is not found in replies, we probably should just ignore it 
but not failing.
   ```diff
   +++ b/ratis-netty/src/main/java/org/apache/ratis/netty/NettyRpcProxy.java
   @@ -157,6 +157,9 @@ public class NettyRpcProxy implements Closeable {
            protected void channelRead0(ChannelHandlerContext ctx,
                                        RaftNettyServerReplyProto proto) {
              final CompletableFuture<RaftNettyServerReplyProto> future = 
getReplyFuture(getCallId(proto), null);
   +          if  (future == null) {
   +            return;
   +          }
              if (proto.getRaftNettyServerReplyCase() == EXCEPTIONREPLY) {
                final Object ioe = 
ProtoUtils.toObject(proto.getExceptionReply().getException());
                future.completeExceptionally((IOException)ioe);
   @@ -199,7 +202,6 @@ public class NettyRpcProxy implements Closeable {
        private CompletableFuture<RaftNettyServerReplyProto> 
getReplyFuture(long callId,
            CompletableFuture<RaftNettyServerReplyProto> expected) {
          final CompletableFuture<RaftNettyServerReplyProto> removed = 
replies.remove(callId);
   -      Objects.requireNonNull(removed, () -> "Request #" + callId + " not 
found");
          if (expected != null) {
            Preconditions.assertSame(expected, removed, "removed");
          }
   ```
   


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