-
Notifications
You must be signed in to change notification settings - Fork 56
snc-library: Delete the failed pods before check for available one #921
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
Open
praveenkumar
wants to merge
1
commit into
crc-org:master
Choose a base branch
from
praveenkumar:issue_920
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
My understanding of
all_pods_are_running_completedis that it tells us if there are pods which are not in theRunningstate nor in theCompletedstate. If we start deleting these pods before doing the check, is it worth keeping the check at all?Which pods get to this weird
ContainerStatusUnknownstate? Is there any explanation for this? Maybe we can only delete pods in thisContainerStatusUnknownstate if we are sure it's always a false positive forall_pods_are_running_complete?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 are only deleting the pods which have in
Failedphase , there might be other phase of pod likepending. (https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-phase )We did try to describe those pods but doesn't get proper explanation, just get the phase as
Failed:(when container goes to this state the phase become
Failedand that is used for field-section option. There is no option aroundContainerStatusUnknownstate in the field section side. It shouldn't provide a false positive because there we are making sure no failed container but also not a pending state container.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.
Do we have a strict equivalence between
FailedandContainerStatusUnknown? In other words, if a container in theFailedphase, it always hasContainerStatusUnknown, and if a container hasContainerStatusUnknown, it always is in theFailedphase. The latter is true, but is the former also trueFailedimpliesContainerStatusUnknown, and nothing else? We don't want to ignoreFailedcontainers which are notContainerStatusUnknown.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.
Second assumption is correct
if a container has ContainerStatusUnknown then it always in the Failed phaseThere can be many reason a container can be in
Failedphase like resource limitation or dependent resource not available ...etc. and most of the time it retries and change the phase like containercreatingorpending. If we delete aFailedpod which is associated with a deployment (which is the case for all the operator) then new pod come up. Even theContainerStatusUnknownstate pod is deleted and associated with deployment it will come up a new one so it is not like we ignoring it but we are making sure once we delete the failed one the new pods initiated by respective deployment should be green.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.
With this explanation, it makes sense to add a
retry_failed_podsmethod which will do theoc delete. It's really unexpected that the methodall_pods_are_running_or_completedwould delete pods or ensure the failed pods are restated.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.
added
retry_failed_podsand this method is called fromall_pods_are_running_or_completed.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.
If you call
retry_failed_podsfromall_pods_are_running_or_completed, you still have the same issue I described in the previous comment: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 already delete the failed pods here
snc/snc-library.sh
Line 271 in 26b44f5
Are there new failed pods appearing while we are waiting for all the pods to be ready?
all_pods_are_running_or_completedhas anignore_namespaceparameter, should we also ignore that namespace when deleting?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.
@cfergeau yes that's the reason we are putting it in
all_pods_are_running_or_completedfunction.No, we don't need to ignore namespace for deleting failed pods.
Uh oh!
There was an error while loading. Please reload this page.
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.
So even something like this is not enough?
The removal of this
oc delete podscould be part of this PR..Why? This makes
all_pods_are_running_or_completedeven more odd and confusing.