chenyulin0719 commented on code in PR #871:
URL: https://github.com/apache/yunikorn-k8shim/pull/871#discussion_r1698688723
##########
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:
handleRejectApplicationEvent() is an event for Application FSM state.
It's not related to this PR, after 1.7.0, we will reject 'Task' if it's pod
have conflicting metadata. the postTaskRejected check "whether the Task was
rejected by conflicting metadata", if yes, fail the task's pod."
This PR won't change the Application FSM to 'Rejected' state.
--
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]