Skip to content

Conversation

jbr
Copy link
Contributor

@jbr jbr commented Oct 15, 2020

I'm not entirely sure if this is a bug or just unexpected behavior, but I thought I'd write a quick PR just in case. Prior to this PR, io::copy continues to poll the reader after it has already returned Poll::Ready(Ok(0)) in the situation where the writer's flush is not immediately Ready. This resulted in a bug with a Read implementation that expected not to be read again after it returned eof. Removing the after-eof polling might save someone else from some confusion

@jbr jbr requested a review from dignifiedquire October 17, 2020 00:03
@joshtriplett
Copy link
Contributor

@jbr Could you add a test for this, with some artificially constructed futures? The artificial read future can panic if it gets polled after EOF.

@jbr jbr requested a review from joshtriplett June 2, 2022 19:04
@jbr
Copy link
Contributor Author

jbr commented Jun 2, 2022

Confirmed locally that the test does in fact fail with the changes to async_std::io::copy stashed

@jbr
Copy link
Contributor Author

jbr commented Jun 2, 2022

I do think it's worth figuring out if this was a bug previous to this commit. It was unspecified in documentation, and it's unclear if someone might be relying on the "continues to poll after eof" behavior, although that seems unlikely. I think this change is worth making either way, but the question is whether it's a breaking change or a bugfix

Copy link
Member

@Fishrock123 Fishrock123 left a comment

Choose a reason for hiding this comment

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

I think this is a bug fix.

@yoshuawuyts yoshuawuyts merged commit 21b72eb into async-rs:main Jun 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants