Skip to content
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

fix: cio.Cancel() should close the pipes #8334

Merged
merged 1 commit into from
May 31, 2023

Conversation

davidhsingyuchen
Copy link
Contributor

@davidhsingyuchen davidhsingyuchen commented Mar 31, 2023

PR fixes #8326 (tested locally on my side). I'm not an expert of containerd though, so I'm not 100% sure if this has any negative side effects, and I appreciate any guidance on how this should be approached, thanks!

PR fixes containerd#8326.

Signed-off-by: Hsing-Yu (David) Chen <davidhsingyuchen@gmail.com>
@k8s-ci-robot
Copy link

Hi @davidhsingyuchen. Thanks for your PR.

I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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/test-infra repository.

@davidhsingyuchen
Copy link
Contributor Author

@AkihiroSuda PTAL, thanks!

@AkihiroSuda
Copy link
Member

/ok-to-test

@AkihiroSuda AkihiroSuda added the cherry-pick/1.7.x Change to be cherry picked to release/1.7 branch label May 18, 2023
cancel: cancel,
cancel: func() {
cancel()
for _, c := range pipes.closers() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we need to close fifos?

Copy link
Contributor Author

@davidhsingyuchen davidhsingyuchen May 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fifos.close() actually removes the FIFOs:

closer := func() error {
return os.RemoveAll(dir)
}

which means we won't be able to cio.Attach to those FIFOs later (example).

Copy link
Member

@ktock ktock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fahedouch
Copy link
Member

thanks, LGTM

@kzys kzys merged commit 9e834e7 into containerd:main May 31, 2023
@davidhsingyuchen davidhsingyuchen deleted the fix-io-cancel branch May 31, 2023 17:40
davidhsingyuchen pushed a commit to davidhsingyuchen/containerd that referenced this pull request Jun 1, 2023
davidhsingyuchen pushed a commit to davidhsingyuchen/containerd that referenced this pull request Jun 1, 2023
fix: cio.Cancel() should close the pipes
(cherry picked from commit 9e834e7)
Signed-off-by: Hsing-Yu (David) Chen <davidhsingyuchen@gmail.com>
@estesp estesp added cherry-picked/1.7.x PR commits are cherry-picked into release/1.7 branch and removed cherry-pick/1.7.x Change to be cherry picked to release/1.7 branch labels Jun 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-picked/1.7.x PR commits are cherry-picked into release/1.7 branch ok-to-test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IO.Cancel() becomes a no-op if the FIFOs are already opened
7 participants