chia7712 commented on code in PR #871:
URL: https://github.com/apache/yunikorn-k8shim/pull/871#discussion_r1697316398


##########
pkg/common/constants/constants.go:
##########
@@ -86,6 +86,8 @@ var SchedulingPolicyStyleParamValues = 
map[string]string{"Hard": "Hard", "Soft":
 
 const ApplicationInsufficientResourcesFailure = "ResourceReservationTimeout"
 const ApplicationRejectedFailure = "ApplicationRejected"
+const TaskRejectedFailure = "TaskRejected"
+const TaskPodInconsistMetadataFailure = "PodInconsistentMetadata"

Review Comment:
   `TaskPodInconsistMetadataFailure` -> `TaskPodInconsistentMetadataFailure`



##########
pkg/cache/task.go:
##########
@@ -457,16 +474,21 @@ func (task *Task) postTaskBound() {
        }
 }
 
-func (task *Task) postTaskRejected() {
-       // currently, once task is rejected by scheduler, we directly move task 
to failed state.
-       // so this function simply triggers the state transition when it is 
rejected.
-       // but further, we can introduce retry mechanism if necessary.
+func (task *Task) postTaskRejected(reason string) {
+       // if task is rejected because of conflicting metadata, we should fail 
the pod with reason
+       if strings.Contains(reason, constants.TaskPodInconsistMetadataFailure) {
+               // Before version 1.7.0, this path would never be reached.
+               // After version 1.7.0, task pod should fail if pod has 
conflicting metadata.
+               task.failTaskPodWithReasonAndMsg(constants.TaskRejectedFailure, 
reason)

Review Comment:
   Pardon me, why we don't handle it in `handleRejectApplicationEvent`?



##########
pkg/cache/task.go:
##########
@@ -543,7 +565,62 @@ func (task *Task) releaseAllocation() {
 // some sanity checks before sending task for scheduling,
 // this reduces the scheduling overhead by blocking such
 // request away from the core scheduler.
-func (task *Task) sanityCheckBeforeScheduling() error {
+func (task *Task) sanityCheckBeforeScheduling() (error, bool) {
+       rejectTask := false

Review Comment:
   it seems `rejectTask` is always "false"?



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