codings-dan commented on code in PR #744:
URL: https://github.com/apache/ratis/pull/744#discussion_r969530466


##########
ratis-metrics/src/main/java/org/apache/ratis/metrics/impl/MetricRegistriesImpl.java:
##########
@@ -62,12 +63,17 @@ public MetricRegistriesImpl(MetricRegistryFactory factory) {
   public RatisMetricRegistry create(MetricRegistryInfo info) {
     return registries.put(info, () -> {
       if (reporterRegistrations.isEmpty()) {
-        if (LOG.isDebugEnabled()) {
-          LOG.debug("First MetricRegistry has been created without registering 
reporters. " +
-              "Hence registering JMX reporter by default.");
+        synchronized (registerLock) {

Review Comment:
   I think `synchronized (this)` can be used directly here and revome 
`registerLock`



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