-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
libpod: remove UpdateContainerStatus() #23644
libpod: remove UpdateContainerStatus() #23644
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Luap99 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 |
@mheon PTAL |
This was dealing with a legitimate bug ( |
Should we trust the clean-up process to update the state? I don't follow the logic here. This function was only called when kill failed (i.e. ESRCH) in which case the container process wasn't running so why should podman kill have to do anything in this case besides reporting an error? |
The original issue this was attempting to fix is #8086 - sig-proxy errors, apparently? UpdateContainerStatus definitely feels like the wrong way to resolve those. It feels like a manual kill with signal 0, check for ESRCH, would be more than sufficient to suppress the error? |
e502095
to
223d363
Compare
LGTM on my end. I don't think the original issue is easy to reproduce, so spending that much effort on it probably not a good idea |
There are two major problems with UpdateContainerStatus() First, it can deadlock when the the state json is to big as it tries to read stderr until EOF but it will never hit EOF as long as the runtime process is alive. This means if the runtime json is to big to git into the pipe buffer we deadlock ourselves. Second, the function modifies the container state struct and even adds and exit code to the db however when it is called from the stop() code path we will be unlocked here. While the first problem is easy to fix the second one not so much. And when we cannot update the state there is no point in reading the from runtime in the first place as such remove the function as it does more harm then good. And add some warnings the the functions that might be called unlocked. Fixes containers#22246 Signed-off-by: Paul Holzinger <[email protected]>
223d363
to
ddece75
Compare
/lgtm |
There are two major problems with UpdateContainerStatus() First, it can deadlock when the the state json is to big as it tries to read stderr until EOF but it will never hit EOF as long as the runtime process is alive. This means if the runtime json is to big to git into the pipe buffer we deadlock ourselves.
Second, the function modifies the container state struct and even adds and exit code to the db however when it is called from the stop() code path we will be unlocked here.
While the first problem is easy to fix the second one not so much. And when we cannot update the state there is no point in reading the from runtime in the first place as such remove the function as it does more harm then good.
And add some warnings the the functions that might be called unlocked.
Fixes #22246
Does this PR introduce a user-facing change?