haiyang1987 commented on a change in pull request #3630:
URL: https://github.com/apache/hadoop/pull/3630#discussion_r748030915



##########
File path: 
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/lib/MutableRollingAverages.java
##########
@@ -167,7 +167,7 @@ synchronized void replaceScheduledTask(int windows, long 
interval,
   }
 
   @Override
-  public void snapshot(MetricsRecordBuilder builder, boolean all) {
+  public synchronized void snapshot(MetricsRecordBuilder builder, boolean all) 
{

Review comment:
       @ferhui @tomscut @AlphaGouGe Thanks your comment.
   this logic is only called when DataNode JMX get SendPacketDownstreamAvgInfo 
Metrics, 
   so there is no concurrency security issue at the moment, no need to add 
synchronized method.
   Update PR.




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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to