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

Use partial-io to shake out Interrupted-related bugs #20

Merged
merged 2 commits into from
May 31, 2017

Conversation

sunshowers
Copy link
Contributor

@sunshowers sunshowers commented May 31, 2017

partial-io is a helper library that lets users wrap readers and writers and
generate partial reads, or fail with temporary errors like Interrupted. It
also integrates with quickcheck to provide random sequences of test instances.

partial-io found a bug on the write side: we weren't handling Interrupted, even
though AsyncWrite requires that Interrupted errors be handled at this layer.

Closes #19.

…ndled

`partial-io` is a helper library that lets users wrap readers and writers and
generate partial reads, or fail with temporary errors like `Interrupted`. It
also integrates with `quickcheck` to provide random sequences of test instances.

Looks like the read side handles `Interrupted` errors correctly. The write side
currently doesn't, and the next commit will fix it.
Make the `BzEncoder` and `BzDecoder` writers retry on `Interrupted` errors
rather than bubbling them up. This also means that they now obey `AsyncWrite`
rules, which prohibit `Interrupted` errors from being bubbled up.

Closes alexcrichton#19.
@alexcrichton
Copy link
Owner

Thanks for the PR! I'm not sure this is the intended purpose though? This changes a few functions to loop on Interrupted, but the intention is to propagate it outwards to callers. Otherwise with nonblocking I/O won't these functions just spin?

@alexcrichton
Copy link
Owner

oops didn't mean to close

@sunshowers
Copy link
Contributor Author

Hm, I might be missing something, but Interrupted isn't WouldBlock. If you remember, we decided in tokio-io that AsyncWrites should propagate WouldBlock but retry on Interrupted.

@alexcrichton
Copy link
Owner

Whoops right yes!

@alexcrichton alexcrichton merged commit 9834534 into alexcrichton:master May 31, 2017
@sunshowers sunshowers deleted the write-intr branch May 31, 2017 18:17
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.

2 participants