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


##########
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:
   These are all `REQUEST` events which means they will be sent to the 
respective pods. 
   
   I think the only message which might be useful is an indication that a 
particular pod successfully triggered preemption. Or the other way around: we 
send a message to the terminated pod that it's been preempted to make room for 
pod X.
   
   Everything else (guarantees passed/failed, precondition passed/failed) is 
just too much noise which should not be sent to K8s as a pod event.



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