runzhiwang opened a new pull request #87:
URL: https://github.com/apache/incubator-ratis/pull/87


   What's the problem ?
   When run test, a lot of exception was thrown, as the image shows.
   
![image](https://user-images.githubusercontent.com/51938049/81052182-953a9e80-8ef5-11ea-8661-70d5bdd1751b.png)
   
   What's the reason ?
   When run into onError, the call has already been cancelled, there is no need 
to call onCompleted. And there is [a similar 
problem](https://github.com/scalapb/ScalaPB/issues/71) in other project.
   You can find why the exception was thrown in the following code, copied from 
[gRPC].(https://github.com/grpc/grpc-java/blob/master/stub/src/main/java/io/grpc/stub/ServerCalls.java).
   ```
       @Override
       public void onCompleted() {
         if (cancelled) {
           if (onCancelHandler == null) {
             throw Status.CANCELLED.withDescription("call already 
cancelled").asRuntimeException();
           }
         } else {
           call.close(Status.OK, new Metadata());
           completed = true;
         }
       }
   ```


----------------------------------------------------------------
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:
[email protected]


Reply via email to