craigcondit commented on code in PR #957:
URL: https://github.com/apache/yunikorn-core/pull/957#discussion_r1744007704


##########
pkg/scheduler/objects/allocation.go:
##########
@@ -565,3 +567,39 @@ func (a *Allocation) setUserQuotaCheckPassed() {
                a.askEvents.SendRequestFitsInUserQuota(a.allocationKey, 
a.applicationID, a.allocatedResource)
        }
 }
+
+func (a *Allocation) setPreemptionPreConditionsCheckPassed() {
+       a.Lock()
+       defer a.Unlock()
+       if a.preemptionPreConditionsCheckFailed {
+               a.preemptionPreConditionsCheckFailed = false
+               
a.askEvents.SendPreemptionPreConditionsCheckPassed(a.allocationKey, 
a.applicationID, a.allocatedResource)
+       }
+}
+
+func (a *Allocation) setPreemptionPreConditionsCheckFailed() {
+       a.Lock()
+       defer a.Unlock()
+       if !a.preemptionPreConditionsCheckFailed {
+               a.preemptionPreConditionsCheckFailed = true
+               
a.askEvents.SendPreemptionPreConditionsCheckFailed(a.allocationKey, 
a.applicationID, a.allocatedResource)
+       }
+}
+
+func (a *Allocation) setPreemptionQueueGuaranteesCheckPassed() {
+       a.Lock()
+       defer a.Unlock()
+       if a.preemptionQueueGuaranteesCheckFailed {
+               a.preemptionQueueGuaranteesCheckFailed = false
+               
a.askEvents.SendPreemptionQueueGuaranteesCheckPassed(a.allocationKey, 
a.applicationID, a.allocatedResource)
+       }
+}
+
+func (a *Allocation) setPreemptionQueueGuaranteesCheckFailed() {
+       a.Lock()
+       defer a.Unlock()
+       if !a.preemptionQueueGuaranteesCheckFailed {
+               a.preemptionQueueGuaranteesCheckFailed = true
+               
a.askEvents.SendPreemptionQueueGuaranteesCheckFailed(a.allocationKey, 
a.applicationID, a.allocatedResource)
+       }
+}

Review Comment:
   We *must not* log for every attempt as this happens far too frequently. It 
will overwhelm the system. Currently in the scheduler we only log *when action 
is taken or the state of the system changes*.



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