-
Notifications
You must be signed in to change notification settings - Fork 3.8k
make sure console master tty is closed on task exit #11161
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
Conversation
c448293 to
4dd66e1
Compare
d2728aa to
dfc8bd6
Compare
dfc8bd6 to
8a238f6
Compare
ad49a39 to
e593ccd
Compare
|
the pr will delete epollConsole, but before delete I think it should be closed when container exited. @henry118 |
The console FD will be closed by go runtime's finalizer during GC. This logic is setup in os/file_unix.go. Relevant stack trace for in our case is below. I think it should be good enough for this fix. However I do agree that explicitly closing the FD in the shim could be a good enhancement. But I think it can be a follow-up work. |
|
can this pr be merged ? @fuweid @laurazard @dmcgowan we meet same issue. |
|
/cherry-pick release/2.0 |
|
@austinvazquez: new pull request created: #11246 DetailsIn response to this:
Instructions 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-sigs/prow repository. |
|
/cherry-pick release/1.7 |
|
@austinvazquez: new pull request created: #11247 DetailsIn response to this:
Instructions 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-sigs/prow repository. |
|
/cherry-pick release/1.6 |
|
@fuweid: new pull request created: #11322 DetailsIn response to this:
Instructions 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-sigs/prow repository. |
|
Great catch, thank you @henry118! |
Fixes: #11160
Tldr; this issue turned out to be a regression in v1.7.22 (#10651) where init container object is never deleted in a running shim.
It seems like that the init/exec process's console object are closed by golang's gc. In #10651, init container is added to
containerInitExitto track its exit status, but never got removed. This prevented gc from deleting the object, and closing the console FD.This is okay in regular case, there the shim will exit with the init container. But in CRI, the shim has the lifetime of a POD, therefore container objects will accumulate within the shim.
I think we should delete the init objects from the map on task deletion.
cc @laurazard