chia7712 commented on code in PR #839:
URL: https://github.com/apache/yunikorn-core/pull/839#discussion_r1557566072


##########
pkg/scheduler/objects/queue.go:
##########
@@ -957,12 +957,10 @@ func (sq *Queue) addChildQueue(child *Queue) error {
 // This can be executed multiple times and is only effective the first time.
 // This is a noop on an unmanaged queue.
 func (sq *Queue) MarkQueueForRemoval() {
-       // need to lock for write as we don't want to add a queue while marking 
for removal
-       sq.Lock()
-       defer sq.Unlock()
+       children := sq.GetCopyOfChildren()
        // Mark the managed queue for deletion: it is removed from the config 
let it drain.
        // Also mark all the managed children for deletion.
-       if sq.isManaged {
+       if sq.IsManaged() {
                log.Log(log.SchedQueue).Info("marking managed queue for 
deletion",
                        zap.String("queue", sq.QueuePath))
                if err := sq.handleQueueEvent(Remove); err != nil {

Review Comment:
   we don't hold lock now, but `handleQueueEvent` can modify inner variable 
(https://github.com/apache/yunikorn-core/blob/master/pkg/scheduler/objects/queue.go#L557)



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