p-szucs commented on code in PR #8747:
URL: https://github.com/apache/hadoop/pull/8747#discussion_r4063712696
##########
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:
Thanks for the review @K0K0V0K!
I agree with your point, my intention was to lock and serialize as minimal
code part as I can to minimize possible latency, but with the first version it
could be possible that we are working with partly inconsistent data (however I
think as the scheduler changes are done asynchronously, a later validation
should catch them). But I think it is a cleaner approach to lock the queue
first, and then start reading its properties/make computations. The rest of the
method that is locked now is only detaching an asynchronous event to make the
computed changes and debug logging
--
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]