-
Notifications
You must be signed in to change notification settings - Fork 182
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
Send to copyDone when err == nil #767
base: main
Are you sure you want to change the base?
Conversation
The ioproxy helps copy container logs from the normal container fifos to the firecracker uvm's vsock. The copying happens in a go-routine and when complete, it send a notification over the `copyDone` channel to signal to the agent/runtime to cleanup the ioproxy. This change fixes a bug where, if the iopoxy copy finished without an error (i.e. `io.CopyBuffer` got an `EOF` from the read end), the `copyDone` channel was not notified leaving the ioproxy connected to the vsock, but not the container. This change always notifies `copyDone` when the copy finishes. Signed-off-by: Kern Walster <[email protected]>
} | ||
copyDone <- 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.
qq: we close the copyDone
channel regardless of whether the copy succeeds or fails. Shouldn't that indicate the runtime to clean up the ioproxy?
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.
Ah, yes. I missed that. Using the debug logs from #766 we actually don't see the "copied %d" message from
firecracker-containerd/internal/vm/ioproxy.go
Line 147 in fc5e81e
logger.Debugf("copied %d", size) |
io.CopyBuffer
?
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 see the copied
message with your change to explicitly send an error?
this is where we wait for an error in the copy channel. I assumed this should return nil once we close the channel.
Issue #, if available:
Description of changes:
The ioproxy helps copy container logs from the normal container fifos to the firecracker uvm's vsock. The copying happens in a go-routine and when complete, it send a notification over the
copyDone
channel to signal to the agent/runtime to cleanup the ioproxy.This change fixes a bug where, if the iopoxy copy finished without an error (i.e.
io.CopyBuffer
got anEOF
from the read end), thecopyDone
channel was not notified leaving the ioproxy connected to the vsock, but not the container. This change always notifiescopyDone
when the copy finishes.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.