Re: Synchronization problem in FSNameSystemMetrics

2010-01-21 Thread Todd Lipcon
Hi Zlatin, I agree that this access is unsynchronized and thus can be stale. Looking at the implementation of HashMap.size, it doesn't need to do anything except copy a single int, so it shouldn't be a cause for any errors beyond stale data (ie it can't throw a ConcurrentModificationException). I

Synchronization problem in FSNameSystemMetrics

2010-01-13 Thread Zlatin.Balevsky
Hello all, Unless I'm missing something, the synchronization in FSNameSystemMetrics on the 0.20 does not appear correct. It locks on itself while pulling various metrics from the FSNameSystem object. For example, FSNameSystem.getBlocksTotal() delegates to BlocksMap.size() which delegates to the