summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2020-12-12sync: add blocking_recv method to UnboundedReceiver, similar to ↵HEADmasterSunjay Varma
Receiver::blocking_recv (#3262)
2020-12-11util: add constructors to TokioContext (#3221)Alice Ryhl
2020-12-11net: update `TcpStream::poll_peek` to use `ReadBuf` (#3259)Lucio Franco
Closes #2987
2020-12-11net: remove empty udp module (#3260)Evan Cameron
2020-12-10sync: make TryAcquireError public (#3250)Alice Ryhl
The [`Semaphore::try_acquire`][1] method currently returns a private error type. [1]: https://docs.rs/tokio/0.3/tokio/sync/struct.Semaphore.html#method.try_acquire
2020-12-10net: Pass SocketAddr by value (#3125)Nylonicious
2020-12-10docs: fix typo in signal module documentation (#3249)Yusuke Tanaka
2020-12-10toml: enable test-util feature for the playground (#3224)Clemens Koza
2020-12-10watch: fix spurious wakeup (#3234)Alice Ryhl
Co-authored-by: @tijsvd
2020-12-10net: expose poll_* methods on UnixDatagram (#3223)cssivision
2020-12-09task: add missing feature flags for task_local and spawn_blocking (#3237)Nylonicious
2020-12-09chore: prepare for Tokio 1.0 work (#3238)Carl Lerche
2020-12-08time: Fix race condition in timer drop (#3229)bdonlan
Dropping a timer on the millisecond that it was scheduled for, when it was on the pending list, could result in a panic previously, as we did not record the pending-list state in cached_when. Hopefully fixes: ZcashFoundation/zebra#1452
2020-12-09chore: fix stress test (#3233)Blas Rodriguez Irizar
2020-12-07Add stress test (#3222)Blas Rodriguez Irizar
Created a simple echo TCP server that on two different runtimes that is called from a GitHub action using Valgrind to ensure that there are no memory leaks. Fixes: #3022
2020-12-07rt: fix deadlock in shutdown (#3228)bdonlan
Previously, the runtime shutdown logic would first-hand control over all cores to a single thread, which would sequentially shut down all tasks on the core and then wait for them to complete. This could deadlock when one task is waiting for a later core's task to complete. For example, in the newly added test, we have a `block_in_place` task that is waiting for another task to be dropped. If the latter task adds its core to the shutdown list later than the former, we end up waiting forever for the `block_in_place` task to complete. Additionally, there also was a bug wherein we'd attempt to park on the parker after shutting it down which was fixed as part of the refactors above. This change restructures the code to bring all tasks to a halt (and do any parking needed) before we collapse to a single thread to avoid this deadlock. There was also an issue in which canceled tasks would not unpark the originating thread, due to what appears to be some sort of optimization gone wrong. This has been fixed to be much more conservative in selecting when not to unpark the source thread (this may be too conservative; please take a look at the changes to `release()`). Fixes: #2789
2020-12-07sync: forward port 0.2 mpsc test (#3225)Carl Lerche
Forward ports the test included in #3215. The mpsc sempahore has been replaced in 0.3 and does not include the bug being fixed.
2020-12-06net: add TcpStream::into_std (#3189)Fuyang Liu
2020-12-04deps: replace lazy_static with once_cell (#3187)Iban Eguia
2020-12-03rt: fix panic in task abort when off rt (#3159)John-John Tedro
A call to `JoinHandle::abort` releases a task. When called from outside of the runtime, this panics due to the current implementation checking for a thread-local worker context. This change makes accessing the thread-local context optional under release, by falling back to remotely marking a task remotely as dropped. Behaving the same as if the core was stolen by another worker. Fixes #3157
2020-12-03util: prepare v0.5.1 release (#3210)Eliza Weisman
### Added - io: `poll_read_buf` util fn (#2972). - io: `poll_write_buf` util fn with vectored write support (#3156). Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2020-12-03util: add writev-aware `poll_write_buf` (#3156)Eliza Weisman
## Motivation In Tokio 0.2, `AsyncRead` and `AsyncWrite` had `poll_write_buf` and `poll_read_buf` methods for reading and writing to implementers of `bytes` `Buf` and `BufMut` traits. In 0.3, these were removed, but `poll_read_buf` was added as a free function in `tokio-util`. However, there is currently no `poll_write_buf`. Now that `AsyncWrite` has regained support for vectored writes in #3149, there's a lot of potential benefit in having a `poll_write_buf` that uses vectored writes when supported and non-vectored writes when not supported, so that users don't have to reimplement this. ## Solution This PR adds a `poll_write_buf` function to `tokio_util::io`, analogous to the existing `poll_read_buf` function. This function writes from a `Buf` to an `AsyncWrite`, advancing the `Buf`'s internal cursor. In addition, when the `AsyncWrite` supports vectored writes (i.e. its `is_write_vectored` method returns `true`), it will use vectored IO. I copied the documentation for this functions from the docs from Tokio 0.2's `AsyncWrite::poll_write_buf` , with some minor modifications as appropriate. Finally, I fixed a minor issue in the existing docs for `poll_read_buf` and `read_buf`, and updated `tokio_util::codec` to use `poll_write_buf`. Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2020-12-02sync: make add_permits panic with usize::MAX >> 3 permits (#3188)Blas Rodriguez Irizar
2020-12-01example: add back udp-codec example (#3205)cssivision
2020-12-01process: fix the process_kill_on_drop.rs test on non-Linux systems (#3203)Alan Somers
"disown" is a bash builtin, not part of POSIX sh.
2020-12-01ci: reenable CI on FreeBSD i686 (#3204)Alan Somers
It was temporarily disabled in 06c473e62842d257ed275497ce906710ea3f8e19 and never reenabled.
2020-12-01ci: switch FreeBSD CI environment to 12.2-RELEASE (#3202)Alan Somers
12.1 will be EoL in two months.
2020-11-30chore: prepare v0.3.5 release (#3201)Carl Lerche
2020-11-30io: add AsyncFd::with_interest (#3167)HK416-is-all-you-need
Fixes #3072
2020-11-30macros: #[tokio::main] can be used on non-main (#3199)Ivan Tham
2020-11-29runtime: test for shutdown_timeout(0) (#3196)Kyle Kosic
2020-11-29util: add rt to tokio-util full feature (#3194)Alice Ryhl
2020-11-28runtime: fix shutdown_timeout(0) blocking (#3174)Max Sharnoff
2020-11-27signal: expose CtrlC stream on windows (#3186)Niklas Fiekas
* Make tokio::signal::windows::ctrl_c() public. * Stop referring to private tokio::signal::windows::Event in module documentation. Closes #3178
2020-11-26macros: fix outdated documentation (#3180)Rajiv Chauhan
1. Changed 0.2 to 0.3 2. Changed ‘multi’ to ‘single’ to indicate that the behavior is single threaded
2020-11-24time: replace 'ouClockTimeide' in internal docs with 'outside' (#3171)Max Sharnoff
2020-11-24codec: add read_buffer_mut to FramedRead (#3166)漂流
2020-11-23time: use intrusive lists for timer tracking (#3080)bdonlan
More-or-less a half-rewrite of the current time driver, supporting the use of intrusive futures for timer registration. Fixes: #3028, #3069
2020-11-20macros: fix rustfmt on 1.48.0 (#3160)Eliza Weisman
## Motivation Looks like the Rust 1.48.0 version of `rustfmt` changed some formatting rules (fixed some bugs?), and some of the code in `tokio-macros` is no longer correctly formatted. This is breaking CI. ## Solution This commit runs rustfmt on Rust 1.48.0. This fixes CI. Closes #3158
2020-11-20util: fix typo in udp/frame.rs (#3154)cssivision
2020-11-18chore: prepare v0.3.4 release (#3152)Carl Lerche
2020-11-18io: add vectored writes to `AsyncWrite` (#3149)Sean McArthur
This adds `AsyncWrite::poll_write_vectored`, and implements it for `TcpStream` and `UnixStream`. Refs: #3135.
2020-11-17net: add SO_LINGER get/set to TcpStream (#3143)Zeki Sherif
2020-11-16net: add UdpSocket readiness and non-blocking ops (#3138)Carl Lerche
Adds `ready()`, `readable()`, and `writable()` async methods for waiting for socket readiness. Adds `try_send`, `try_send_to`, `try_recv`, and `try_recv_from` for performing non-blocking operations on the socket. This is the UDP equivalent of #3130.
2020-11-16sync: add `Notify::notify_waiters` (#3098)Zahari Dichev
This PR makes `Notify::notify_waiters` public. The method already exists, but it changes the way `notify_waiters`, is used. Previously in order for the consumer to register interest, in a notification triggered by `notify_waiters`, the `Notified` future had to be polled. This introduced friction when using the api as the future had to be pinned before polled. This change introduces a counter that tracks how many times `notified_waiters` has been called. Upon creation of the future the number of times is loaded. When first polled the future compares this number with the count state of the `Notify` type. This avoids the need for registering the waiter upfront. Fixes: #3066
2020-11-16net: Add send/recv buf size methods to `TcpSocket` (#3145)Eliza Weisman
This commit adds `set_{send, recv}_buffer_size` methods to `TcpSocket` for setting the size of the TCP send and receive buffers, and `{send, recv}_buffer_size` methods for returning the current value. These just call into similar methods on `mio`'s `TcpSocket` type, which were added in tokio-rs/mio#1384. Refs: #3082 Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2020-11-16net: restore TcpStream::{poll_read_ready, poll_write_ready} (#2743)masnagam
2020-11-13chore: automate running benchmarks (#3140)Carl Lerche
Uses Github actions to run benchmarks.
2020-11-13chore: update pin-project-lite to 0.2.0 (#3139)Taiki Endo
2020-11-13net: add missing doc cfg on TcpSocket (#3137)Carl Lerche
This adds the missing `net` feature flag in the generated API documentation.