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

Send to copyDone when err == nil #767

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/vm/ioproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ func (connectorPair *IOConnectorPair) proxy(
} else {
logger.WithError(err).Error("error copying io")
}
copyDone <- err
}
copyDone <- err
Copy link
Contributor

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?

Copy link
Contributor Author

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

logger.Debugf("copied %d", size)
which seems like we're actually still stuck in the io.CopyBuffer?

Copy link
Contributor

@swagatbora90 swagatbora90 Sep 22, 2023

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.

defer logClose(logger, reader, writer)
}()

Expand Down