-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[release-1.19] oci: return IsAlive error instead of logging #4157
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
[release-1.19] oci: return IsAlive error instead of logging #4157
Conversation
When a container has been stopped, but the rest of its pod is still stopping, the kubelet still runs exec probes IsAlive() correctly identifies the container has been stopped, and logs an error, but in reality, this is expected. Instead of logging the error, return it in IsAlive (and also ExecSync), and let the kubelet report it if it thinks it'll be problematic This fixes superluous errors like this: "Checking if PID of 4a81020e858fbdd1ee6a271190ab36aec1940489386e177f33c2e62afa309580 is running failed: PID running but not the original container. PID wrap may have occurred" Signed-off-by: Peter Hunt <[email protected]>
|
@openshift-cherrypick-robot: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Codecov Report
@@ Coverage Diff @@
## release-1.19 #4157 +/- ##
================================================
- Coverage 41.58% 41.56% -0.02%
================================================
Files 110 110
Lines 9046 9043 -3
================================================
- Hits 3762 3759 -3
Misses 4944 4944
Partials 340 340 |
| // IsAlive is a function that checks if a container's init PID exists. | ||
| // It is used to check a container state when we don't want a `$runtime state` call | ||
| func (c *Container) IsAlive() bool { | ||
| func (c *Container) IsAlive() 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.
Maybe it's me and my mis-spent youth doing Java, but I don't think any function that starts with "is" should return anything other than a boolean. I'd rename the function.
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.
I will look into this as a follow up in the master version :)
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: haircommander, mrunalp, openshift-cherrypick-robot The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/retest |
This is an automated cherry-pick of #4149
/assign haircommander