From 9626cbc158e7c29fab54daf44dd6ac86943c3c49 Mon Sep 17 00:00:00 2001 From: Kern Walster Date: Thu, 21 Sep 2023 00:28:15 +0000 Subject: [PATCH] Send to copyDone when err == nil 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 --- internal/vm/ioproxy.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/vm/ioproxy.go b/internal/vm/ioproxy.go index 21ccef730..a4a789886 100644 --- a/internal/vm/ioproxy.go +++ b/internal/vm/ioproxy.go @@ -152,8 +152,8 @@ func (connectorPair *IOConnectorPair) proxy( } else { logger.WithError(err).Error("error copying io") } - copyDone <- err } + copyDone <- err defer logClose(logger, reader, writer) }()