K0K0V0K commented on code in PR #8747:
URL: https://github.com/apache/hadoop/pull/8747#discussion_r4060129904


##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/QueueManagementDynamicEditPolicy.java:
##########
@@ -191,7 +191,12 @@ List<QueueManagementChange> manageAutoCreatedLeafQueues()
       try {
         startTime = clock.getTime();
 
-        queueManagementChanges = policyClazz.computeQueueManagementChanges();
+        parentQueue.getReadLock().lock();
+        try {
+          queueManagementChanges = policyClazz.computeQueueManagementChanges();

Review Comment:
   NIT:
   
   Would not be better to apply the read lock at the beginning of  
computeQueueManagementChanges method?
   Cause `if 
(!parentQueue.shouldFailAutoCreationWhenGuaranteedCapacityExceeded()) {` called 
in line 186, so some unexpected behaviour can occur if that change during the 
`computeQueueManagementChanges` run.



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