-
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
Always spawn a cleanup process with exec #10405
Always spawn a cleanup process with exec #10405
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mheon 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 |
LGTM |
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
/hold |
/retest |
I think the errors are legit - I need to handle the already-removed race condition in the exec code. |
0480b6d
to
476c852
Compare
Alright, now I realize why I didn't do this originally. We now have a race where We can potentially work around this by having a special event for exec session exit (Docker uses |
We were previously only doing this for detached exec. I don't know why we did that, but I don't see any reason not to extend it to all exec sessions - it guarantees that we will always clean up exec sessions, even if the original `podman exec` process died. [NO TESTS NEEDED] because I don't really know how to test this one. Signed-off-by: Matthew Heon <[email protected]>
476c852
to
28e866c
Compare
When making Exec Cleanup processes mandatory, I introduced a race wherein attached exec sessions could be cleaned up and removed by the cleanup process before the frontend had a chance to get their exit code. Fortunately, we've dealt with this issue before in containers, and the same solution can be applied here. I added an event for an exec session's process exiting, `exec_died` (Docker has an identical event, so this actually improves our compatibility there) that includes the exit code of the exec session. If the race happens and the exec session no longer exists when we go to remove it, pick up exit code from the event and exit cleanly. Signed-off-by: Matthew Heon <[email protected]>
28e866c
to
62f4b0a
Compare
Re-pushed with a fix. Added an |
Restarted the two jobs. Looked like flakes. |
I think they are, but they seem extremely consistent. |
/hold cancel Oh dear, it went green. @containers/podman-maintainers Anyone want to drop an LGTM? |
/lgtm |
We were previously only doing this for detached exec. I don't know why we did that, but I don't see any reason not to extend it to all exec sessions - it guarantees that we will always clean up exec sessions, even if the original
podman exec
process died.[NO TESTS NEEDED] because I don't really know how to test this one.