-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
IO.Cancel()
becomes a no-op if the FIFOs are already opened
#8326
Comments
PR fixes containerd#8326. Signed-off-by: Hsing-Yu (David) Chen <davidhsingyuchen@gmail.com>
I rechecked containerd base code and I think we misunderstood some some functionalities:
the above comment is missing a very important detail. Looking at the below comment
=> cancel() aborts all current io operations until When I believe we have to
please see how |
|
Ah Sorry! I forgot to check previous comments 😅 |
PR fixes containerd#8326. Signed-off-by: Hsing-Yu (David) Chen <davidhsingyuchen@gmail.com> (cherry picked from commit 82ec62b) Signed-off-by: Hsing-Yu (David) Chen <davidhsingyuchen@gmail.com>
PR fixes containerd#8326. Signed-off-by: Hsing-Yu (David) Chen <davidhsingyuchen@gmail.com>
PR fixes containerd#8326. Signed-off-by: Hsing-Yu (David) Chen <davidhsingyuchen@gmail.com>
Description
The comment of
IO.Cancel()
says "Cancel aborts all current io operations", and I suppose it means stopping the goroutines incopyIO
(e.g., the FIFOs will remain there, but the content will stop being copied to the provided IO streams). However,cio.Cancel()
calls thecancel()
function associated with the context that was passed tofifo.OpenFifo
, which comment says "Context can be used to cancel this function until open(2) has not returned.", which means thatIO.Cancel()
becomes a no-op if the FIFOs are already opened.Steps to reproduce the issue
Describe the results you received and expected
Received
IO.Cancel()
becomes a no-op if the FIFOs are already opened, andIO.Wait()
blocks forever as a result.Expected
IO.Cancel()
should close (not remove) the FIFOs, andIO.Wait()
can be used to detect when that's done.What version of containerd are you using?
containerd github.com/containerd/containerd v1.6.19 1e1ea6e
Any other relevant information
For more context, I'm trying to implement
--detach-keys
fornerdctl
(containerd/nerdctl/pull/2128).Show configuration if it is related to CRI plugin.
No response
The text was updated successfully, but these errors were encountered: