-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fail new builds that can't start build pod because it already exists #12057
Fail new builds that can't start build pod because it already exists #12057
Conversation
glog.V(4).Infof("Build pod already existed: %#v", podSpec) | ||
build.Status.Phase = buildapi.BuildPhaseError | ||
build.Status.Reason = buildapi.StatusReasonBuildPodExists | ||
build.Status.Message = err.Error() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to be checking if the pod is older than the build. if the pod is newer than the build, we should continue to no-op this (it indicates something else managed to create the pod for us).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, sorry, totally forgot about this - updated.
7b5f209
to
9ae2650
Compare
[test][testextended][extended:core(builds)] |
lgtm [merge] |
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/11862/) (Image: devenv-rhel7_5458) |
Consider following scenario: - build is started by user - build controller creates build pod - build is deleted by user - build pod is killed but remains Terminating during grace period - build with same name as in first step is started by user Previously the new build stayed in New phase until the old build pod finished and then went into Failed after the pod terminated. This commit causes the new build to go into Error phase when it first tries creating build pod and fails because pod with the same name (and earlier creationTimestamp) exists. Slightly improves bug 1300949 (the described behavior is still very similar).
9ae2650
to
0cfb747
Compare
Rebased, also updated the code to be in line with #10817 - the message field is set to predefined message instead of propagating the AlreadyExists error. |
Evaluated for origin test up to 0cfb747 |
Evaluated for origin testextended up to 0cfb747 |
[merge] |
Evaluated for origin merge up to 0cfb747 |
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/11862/) (Base Commit: ff5bd5a) |
continuous-integration/openshift-jenkins/testextended FAILURE (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin_extended/853/) (Base Commit: b644d1f) (Extended Tests: core(builds)) |
extended test failure is a known issue. |
Consider following scenario:
Previously the new build stayed in New phase until the old build pod finished and then went into Failed after the pod terminated. This commit causes the new build to go into Error phase when it first tries creating build pod and fails because pod with the same name exists.
Slightly improves bug 1300949 (the described behavior is still very similar).