Lokesh Jain created RATIS-765:
---------------------------------

             Summary: ClientProtoUtils#toRaftClientReplyProto should handle 
AlreadyClosedException
                 Key: RATIS-765
                 URL: https://issues.apache.org/jira/browse/RATIS-765
             Project: Ratis
          Issue Type: Bug
            Reporter: Lokesh Jain
            Assignee: Hanisha Koneru


TestWatchRequestWithGrpc failed with the below exception. This is a result of 
assertion added in RATIS-729. In ClientProtoUtils#toRaftClientReplyProto we 
currently do not propagate AlreadyClosedException in the RaftClientReplyProto.
{code:java}
java.lang.AssertionError: Unexpected exit.

    at org.apache.ratis.util.ExitUtils.assertNotTerminated(ExitUtils.java:109)
    at org.apache.ratis.BaseTest.assertNoFailures(BaseTest.java:75)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at 
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
    at 
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at 
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
    at 
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:33)
    at 
org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:298)
    at 
org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:292)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.ratis.util.ExitUtils$ExitException: 
Thread[grpc-default-executor-5,5,FailOnTimeoutGroup] has thrown an uncaught 
exception
    at org.apache.ratis.util.ExitUtils.terminate(ExitUtils.java:141)
    at org.apache.ratis.util.ExitUtils$States.lambda$new$0(ExitUtils.java:54)
    at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1057)
    at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1052)
    at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1052)
    at java.lang.Thread.dispatchUncaughtException(Thread.java:1959)
Caused by: java.lang.AssertionError: Corruption while serializing reply= 
RaftClientReply:client-8FD5A15E01C2->s2@group-435584180CC1, cid=6, FAILED 
org.apache.ratis.protocol.AlreadyClosedException: 
SlidingWindow$Server:2-OrderedRequestStreamObserver2 is closing: seq = 3 > 
nextToProcess = -1 will NEVER be processed; request = 3:null, logIndex=0, 
commits[] but serialized=rpcReply {
  requestorId: "\357\216\347\031)\304Ii\200\273\217\325\241^\001\302"
  replyId: "s2"
  raftGroupId {
    id: "\256\245\022M\323PHF\207\220CU\204\030\f\301"
  }
  callId: 6
}
 and deserialized=RaftClientReply:client-8FD5A15E01C2->s2@group-435584180CC1, 
cid=6, FAILED null, logIndex=0, commits[]
    at 
org.apache.ratis.client.impl.ClientProtoUtils.toRaftClientReplyProto(ClientProtoUtils.java:205)
    at 
org.apache.ratis.grpc.client.GrpcClientProtocolService$OrderedRequestStreamObserver.sendReply(GrpcClientProtocolService.java:355)
    at 
org.apache.ratis.util.SlidingWindow$RequestMap.endOfRequests(SlidingWindow.java:158)
    at 
org.apache.ratis.util.SlidingWindow$Server.endOfRequests(SlidingWindow.java:469)
    at 
org.apache.ratis.grpc.client.GrpcClientProtocolService$OrderedRequestStreamObserver.onCompleted(GrpcClientProtocolService.java:368)
    at 
org.apache.ratis.thirdparty.io.grpc.stub.ServerCalls$StreamingServerCallHandler$StreamingServerCallListener.onHalfClose(ServerCalls.java:262)
    at 
org.apache.ratis.thirdparty.io.grpc.internal.ServerCallImpl$ServerStreamListenerImpl.halfClosed(ServerCallImpl.java:331)
    at 
org.apache.ratis.thirdparty.io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$1HalfClosed.runInContext(ServerImpl.java:814)
    at 
org.apache.ratis.thirdparty.io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
    at 
org.apache.ratis.thirdparty.io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)
    at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.ratis.protocol.AlreadyClosedException: 
SlidingWindow$Server:2-OrderedRequestStreamObserver2 is closing: seq = 3 > 
nextToProcess = -1 will NEVER be processed; request = 3:null
    at 
org.apache.ratis.util.SlidingWindow$RequestMap.endOfRequests(SlidingWindow.java:155)
    ... 10 more
{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to