bbeaudreault opened a new pull request, #5149:
URL: https://github.com/apache/hbase/pull/5149

   Spotbugs complains because, for example, the assignment of `appendHisto` is 
synchronized but the actual usage in `updateAppend` is not. The first thought 
might be to synchronize all of the methods, but that would be detrimental to 
performance and unnecessary since these metrics are already thread safe.
   
   The synchronization of register/deregister was added as part of the 
LossyCounting stuff for user metrics. So its possible under extreme conditions 
for the LossyCounting thread to deregister a user source which is currently 
being registered. So it's important to synchronize the actual metric 
creation/removal, more than anything else.
   
   There is only one caller of `register/deregister`, here in  
[MetricsUserAggregateSourceImpl](https://github.com/apache/hbase/blob/master/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsUserAggregateSourceImpl.java#L50-L87).
  Note that it's already synchronized. So I think the synchronization here is 
redundant.


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