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


   ## What changes were proposed in this pull request?
   
   **What's the problem ?**
   Failed UT: testRestartLogAppender
   
   **What's the reason ?**
   
[grpcServerMetrics.unregister()](https://github.com/apache/incubator-ratis/blob/master/ratis-grpc/src/main/java/org/apache/ratis/grpc/server/GrpcLogAppender.java#L130)
 was called when GrpcLogAppender stop. If the order is: interrupt old 
GrpcLogAppender ->start new GrpcLogAppender -> 
grpcServerMetrics.onRequestInconsistency -> old GrpcLogAppender turn dead -> 
grpcServerMetrics.unregister when old GrpcLogAppender become dead -> unit test 
check the metric of grpcServerMetrics. Then the unit test failed, because 
grpcServerMetrics has been unregistered.
   
   **How to fix ?**
   grpcServerMetrics.unregister should be called before interrupt old 
GrpcLogAppender, then start new GrpcLogAppender will create a new 
grpcServerMetrics.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/RATIS-964
   
   ## How was this patch tested?
   
   Existed UT
   


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