Skip to content

Conversation

mkantor
Copy link
Owner

@mkantor mkantor commented Dec 6, 2020

Bytes from the end of content streams could be missing from Operator's output.

I'd somehow gotten it into my head that in io::Write, write + flush was the same as write_all (i.e. that non-written bytes were held in some internal buffer that got emptied upon flush). In hindsight this is silly, since io::Write is a trait there's not even anywhere to store such a buffer (individual Write impls could work this way in theory, but at least the one for io::StdoutLock doesn't).

I hadn't noticed this problem until now because apparently write had been writing the entire buffer at once. Something must have changed in the GitHub Actions runners, though, as the issue was 100% reproducible for a certain sample in #42 and all CI runs since that PR was opened.

Bytes from the end of content streams could be missing from Operator's
output.

I'd somehow gotten it into my head that in `io::Write`, `write` +
`flush` was the same as `write_all` (i.e. that non-written bytes were
held in some internal buffer that got emptied upon `flush`). In
hindsight this is silly, since `io::Write` is a trait there's not even
anywhere to store such a buffer (individual `Write` impls could work
this way in theory, but at least the one for `io::StdoutLock` doesn't).

I hadn't noticed this problem until now because apparently `write` had
been writing the entire buffer at once. Something must have changed in
the GitHub Actions runners, though, as the issue was 100% reproducible
for a certain sample in <#42>
and all CI runs since that PR was opened.
@mkantor mkantor merged commit 0181563 into master Dec 6, 2020
@mkantor mkantor deleted the fix-get-and-eval-not-writing-entire-output branch December 6, 2020 21:45
@mkantor mkantor mentioned this pull request Dec 6, 2020
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.

1 participant