xichen01 commented on code in PR #744:
URL: https://github.com/apache/ratis/pull/744#discussion_r1280571163


##########
ratis-grpc/src/main/java/org/apache/ratis/grpc/metrics/MessageMetrics.java:
##########
@@ -82,7 +82,7 @@ public void rpcCompleted(String metricNamePrefix){
   /**
    * Increments the count of RPCs received on the server.
    */
-  public void rpcReceived(String metricNamePrefix){
+  synchronized public void rpcReceived(String metricNamePrefix){

Review Comment:
   This is needed, I've tested and found that it only need this `synchronized` 
to prevent Metrcs leaks,  but I don't exactly know which threads are in 
conflict, so maybe it's safer to add `synchronized` to the other methods?



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