-
Notifications
You must be signed in to change notification settings - Fork 2.7k
stop podman kube play --wait from using 100% CPU #24381
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
stop podman kube play --wait from using 100% CPU #24381
Conversation
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 feel like in order to prevent more of such bugs it would be much better to set a default pollInterval
in func (c *Container) WaitForExit()
, i.e.
if pollInterval <= 0 {
pollInterval = DefaultWaitInterval
}
Yes, I agree. I would like to add your suggestion by reverting my commit, adding the code and adding a comment to |
Yes you can drop your commit and then add a new one with the default logic. Reverting (in terms of git revert command) makes no sense in a PR context because that adds a second commit which undo the changes so they still end up being in the git history. I mark this as no tests needed, given the current functionality is already in some tests and pass it will be pretty hard to add a solid automatic test into our CI system. We would need to track CPU usage of the process which will be unreliable in CI systems and not something we have done before in CI tests AFAIK. |
ddff064
to
2f6fca6
Compare
Signed-off-by: Maximilian Hueter <maximilian.hueter@icloud.com>
4f02cd3
to
314dece
Compare
/approve |
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Luap99, rhatdan, t4chib4ne The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
When running
podman kube play --wait pod.yaml
the podman process invoked on the commandline will use 100% of a single CPU waiting for the pod to exit.This can be reproduced with the following file and then opening another terminal and observing the CPU load of the process.
This is fixed by adding a proper
Interval
value to the options given toContainerWait
. Previously the default value oftime.Duration
was used which is 0 thus creating a busy-wait.I have set it to 250ms similarly how it was done here #18149
Likewise I don't know if there are additional tests needed for this PR.
Does this PR introduce a user-facing change?