-
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
Do not segfault on hard stop #23666
Do not segfault on hard stop #23666
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rhatdan 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 |
@containers/podman-maintainers PTAL |
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 to fix the panic but I do wonder if we do not have to check the http result here.
@baude should this check if http status is success at least?
Podman machine on MAC can segfault on hard stop. Fixes: 23654 Signed-off-by: Daniel J Walsh <[email protected]>
Since lots of tests are failing, going back to ignoring error. |
LGTM |
@@ -83,7 +83,9 @@ func (vf *Helper) stateChange(newState rest.StateChange) error { | |||
} | |||
payload := bytes.NewReader(b) | |||
serverResponse, err := vf.post(vf.Endpoint+state, payload) | |||
_ = serverResponse.Body.Close() | |||
if err == nil { | |||
_ = serverResponse.Body.Close() |
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 you need to check if serverResponse is nil and/or the Body?
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 don't think so, unless we have to check this everywhere. v.get() as well.
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 vf.post() returns an error then serverResponse is nil. I would think client.Do(req) will return the correct serverResponse or nil with an err.
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.
yeah checking the error alone should be fine
426aac3
into
containers:main
Podman machine on MAC can segfault on hard stop.
Fixes: #23654
Does this PR introduce a user-facing change?