While debugging in eclipse came across a scenario where in i had to get to know the name of the queue but every time i tried to see the queue it was getting hung. On seeing the stack realized there was a deadlock but on analysis found out that it was only due to queue.toString() during debugging as AbstractCSQueue.getAbsoluteUsedCapacity was synchronized.
Hence we need to ensure following :
- queueCapacity, resource-usage has their own read/write lock hence synchronization is not req
- numContainers is volatile hence synchronization is not req.
- read/write lock could be added to Ordering Policy. Read operations don't need synchronized. So getNumApplications doesn't need synchronized.
(First 2 will be handled in this jira and the third will be handled in YARN-4443)