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

SafeReader doesn't detect stalled transfers #272

Open
wellsie1116 opened this issue Feb 2, 2020 · 0 comments
Open

SafeReader doesn't detect stalled transfers #272

wellsie1116 opened this issue Feb 2, 2020 · 0 comments

Comments

@wellsie1116
Copy link

If min_bytes_per_second is non-zero and a transfer is making forward progress but more slowly than required, the stream should error out as expected, however, as poll_read is only expected to be called when more data is available (or the future has otherwise been woken up), if a transfer stalls out completely, nothing will currently wake up the reader for it to detect the stall and produce an error.

It looks like it will need to setup a timer on every call to poll_read that is associated with the Context, but I don't think there is an async cross platform timer crate we could use here yet.

There is also the larger topic of how to test this type without having tests that run longer than 30 seconds (the minimum amount of time before SafeReader enforces a minimum transfer rate) that would be useful to solve too.

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

No branches or pull requests

1 participant