async-rs / async-rs/async-std

Force timeout on potentially blocking IO calls

Open
#607 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
4.1k
Forks
339
PR merge metrics
No merged PRs in 30d

Description

Recently I encountered a bug where when a buffer associated with a file descriptor(`TcpStream`) is filled, `stream.write` will block forever. Bugs of this nature are very hard to find.

[`std::net::TcpStream`](https://doc.rust-lang.org/std/net/struct.TcpStream.html#method.set_write_timeout) have functions such as `set_write_timeout`, `set_read_timeout` in addition to `set_nonblocking`. I believe async-std would benefit by including a similar `set_write_timeout` function on potentially blocking IO functions so write would return a TimeoutFuture.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.