Commit Graph
4455 Commits
Author SHA1 Message Date
Alice Ryhl 8c600d0fd2 Merge 'tokio-1.47.5' into 'tokio-1.51.x' (#8123) 2026-05-07 13:59:06 +02:00
Alice RyhlandGitHub 11bfc1345b chore: prepare Tokio v1.47.5 (#8122) tokio-1.47.5 2026-05-07 13:55:35 +02:00
Alice RyhlandGitHub f085b6211b sync: notify receivers in mpsc OwnedPermit::release() method (#8075) 2026-05-07 09:32:14 +02:00
Alice RyhlandGitHub 30d25ccb8b sync: require that an RwLock has max_readers != 0 (#8076) 2026-05-07 09:31:12 +02:00
Alice RyhlandGitHub 9fccf5339d sync: return Empty from try_recv() when mpsc is closed with outstanding permits (#8074) 2026-05-07 09:30:50 +02:00
Alice RyhlandGitHub ebf61b45b5 sync: fix underflow in mpsc channel len() (#8062) 2026-05-07 09:29:33 +02:00
Alice RyhlandGitHub 64834ec701 chore: prepare Tokio v1.51.2 (#8113) tokio-1.51.2 2026-05-04 12:11:07 +02:00
Alice RyhlandGitHub 967f5715a7 runtime: revert "steal tasks from the LIFO slot" (#8100)
This reverts commit eeb55c733b.
2026-05-04 10:08:30 +02:00
Alice Ryhl a97cf12ed9 Merge tokio-1.47.x (commit 670a907c55) into tokio-1.51.x (#8105) 2026-05-02 13:52:07 +02:00
Alice Ryhl bde3f20b0f Pin stable to 1.94 for tokio-1.51.x (#8105) 2026-05-02 13:51:31 +02:00
670a907c55 ci: fix CI on tokio-1.47.x (#8101)
Co-authored-by: Mattia Pitossi <[email protected]>
2026-05-02 13:33:40 +02:00
Alice RyhlandGitHub 98df02d7a4 chore: prepare Tokio v1.51.1 (#8023) tokio-1.51.1 2026-04-08 12:37:44 +02:00
dentinyandGitHub 3ea11e2a5f sync: fix semaphore reopens after forget (#8021) 2026-04-08 07:59:54 +00:00
Mattia PitossiandGitHub c79121391d rt: do not leak fd when cancelling io_uring open operation (#7983) 2026-04-08 07:37:19 +02:00
Marvin VogtandGitHub ad8c59add6 net: surface errors from SO_ERROR on recv for UDP sockets on Linux (#8001) 2026-04-04 21:46:10 +02:00
Alice RyhlandGitHub 654d38b132 metrics: fix worker_local_schedule_count test (#8008) 2026-04-04 09:20:01 +02:00
Mattia PitossiandGitHub 857ba80933 docs: improve contributing docs on how to specify crates dependency versions (#8009) 2026-04-04 09:03:49 +02:00
Alice RyhlandGitHub 95b9342da7 chore: remove path deps for tokio-macros 2.7.0 (#8007) 2026-04-03 11:10:55 +02:00
Alice RyhlandGitHub 0af06b7bab chore: prepare Tokio v1.51.0 (#8005) tokio-1.51.0 2026-04-03 10:42:05 +02:00
Alice RyhlandGitHub 01a7f1dfab chore: prepare tokio-macros v2.7.0 (#8004) tokio-macros-2.7.0 2026-04-03 09:37:58 +02:00
Eliza WeismanandGitHub eeb55c733b runtime: steal tasks from the LIFO slot (#7431) 2026-04-03 09:11:58 +02:00
DakshandGitHub 1fc450aefb runtime: stabilize LocalRuntime (#7557) 2026-04-02 13:13:24 +00:00
Alice Ryhl 324218f9bb Merge tag 'tokio-1.47.4' (#8003) 2026-04-02 14:16:40 +02:00
Alice RyhlandGitHub aa65d0d0b8 chore: prepare Tokio v1.47.4 (#8002) tokio-1.47.4 2026-04-02 14:12:06 +02:00
LeoniePhilineandAlice Ryhl bf18ed452d sync: fix panic in Chan::recv_many when called with non-empty vector on closed channel (#7991)
`Chan::recv_many` intends to assert that no slots
have been consumed when exiting with `Ready` via
the `rx_closed` code path.

Instead of asserting no items were added to the
buffer, it asserted buffer emptiness, incorrectly
making assumptions about the provided buffer.

When `recv_many` was called on an empty channel
with idle semaphore after the receiver was closed,
the method would panic.

The branch coverage had been previously missing.

This changeset corrects the assertion
and adds tests covering the code path.

Fixes #7990.
2026-04-02 13:16:03 +02:00
Joel DiceandGitHub 43134f1e57 wasm: add wasm32-wasip2 networking support (#7933)
Motivation

This adds networking support for the `wasm32-wasip2` target platform, which
includes more extensive support for sockets than `wasm32-wasip1`.

Solution

The bulk of the changes are in https://github.com/tokio-rs/mio/pull/1931.  This
patch mainly tweaks a few `cfg` directives to indicate `wasm32-wasip2`'s
additional capabilities.

Note that this is a draft PR until until
https://github.com/tokio-rs/mio/pull/1931 and
https://github.com/rust-lang/socket2/pull/639 have been include in stable
releases of their respective projects.

Also note that I've added a `wasm32-wasip2` target to CI and triaged each test
which was previously disabled for WASI into one of three categories:

- Disabled on both WASIp1 and p2 due to not-yet-supported features such as multithreading
- Disabled on p1 but enabled on p2
- Disabled on p1 and _temporarily_ disabled on p2 due to `wasi-libc` bugfixes which have been merged but not yet included in a Rust release.  I'll open an issue to re-enable them when the fixes land in Rust.

Future Work

In the future, we could consider adding support for `tokio::net::lookup_host`.
WASIp2 natively supports asynchronous DNS lookups and is single threaded,
whereas Tokio currently assumes DNS lookups are blocking and require
multithreading to emulate async lookups.  A WASIp2-specific implementation could
do the lookup directly without multithreading.

WASIp2 also supports single-threaded, asynchronous file I/O, timers, etc.  We
could either support those directly or wait for WASIp3's multithreading support,
in which case most of `tokio::fs` (as well as `tokio::net::lookup_host`, etc.)
_should_ work unchanged via `wasi-libc` and worker threads.

Currently, building for WASIp2 requires RUSTFLAGS="--cfg tokio_unstable"`.  Once
we have a solid maintenance plan, we can remove that requirement.
2026-04-02 11:53:17 +02:00
Adam MartinezandGitHub b4c3246d33 macros: improve overall macro hygiene (#7997)
Multiple macro expansions were previously assumming the existence of
some standard library symbols to both be in-scope and referring to the
right symbol, and not only having the same identifier.

This has now been refactored into using reexports from the `support`
module under the `macros` module. Some other macro invocations were also
using absolute standard library paths instead of calling into the afore
mentioned module through the special `$crate` macro. This has been
changed, thus also reexporting some other items in `support`.
2026-04-02 11:46:57 +02:00
Mattia PitossiandGitHub 7947fa4bd7 rt: add runtime name (#7924) 2026-04-01 09:46:27 +00:00
Hegui DaiandGitHub 9f132172db sync: fix notify_waiters priority in Notify (#7996)
Previously, if a `notify_waiters()` was followed by a `notify_one()`,
an unpolled `Notified` future created before the `notify_waiters()`
call would consume the `NOTIFIED` permit created by the
`notify_one()` call.

This commit fixes this by verifying the `notify_waiters_calls` count
before optimistically attempting to acquire the `NOTIFIED` permit. If
the count indicates a `notify_waiters()` call has already happened, the
future transitions directly to `State::Done` and leaves the permit
intact for other waiters.

Fixes: #7965
2026-03-31 13:52:02 +02:00
Sim-huandGitHub 6752f50154 examples: add graceful shutdown example (#7962) 2026-03-30 11:05:53 +02:00
xtqqczzeandGitHub 6c72168a93 ci: remove Rust 1.94.0 workarounds (#7987) 2026-03-30 10:44:47 +02:00
Pino ToscanoandGitHub ee4de81806 net: use null get_peer_cred on Hurd (#7989) 2026-03-27 09:38:54 +01:00
Jess IzenandGitHub a8435c0fc8 examples: add FD table pre-warming example (#7978) 2026-03-26 08:17:27 -07:00
Charlie TonneslanandGitHub 467d614267 bench: use is_multiple_of instead of manual modulo check (#7984)
Addresses clippy::manual_is_multiple_of warning on latest stable.
2026-03-22 14:00:12 +01:00
Martin GrigorovandGitHub 66c786540e chore: Do not show "Available on non-loom only." doc label (#7977)
* chore: Do not show "Available on non-loom only." doc label

Closes #7976

Uses the unstable #[doc(cfg()]. https://github.com/rust-lang/rust/issues/43781

* Use build.rs to detect nightly builds

* Use `docsrs` instead of `nightly`. Drop build.rs

* Use doc(auto_cfg(hide(config_name)))

* Use same nightly on CirrusCI (FreeBSD) as on Github Actions CI
2026-03-18 15:14:02 +02:00
figsodaandGitHub dd1196d369 ci: patch workspace members to disambiguate --package (#7967) 2026-03-18 07:27:46 +01:00
figsodaandGitHub 2db0070eb8 stream: impl FromStream for std::collections::* (#7966) 2026-03-16 16:00:49 +01:00
Russell CohenandGitHub 26de3187e7 runtime: add tokio::runtime::worker_index() (#7921) 2026-03-14 22:44:41 -07:00
Chris DentonandGitHub d3c7f56c10 ci: workaround for OpenOptionsExt in 1.94.0 (#7968) 2026-03-13 10:53:13 +00:00
Alex GaynorandGitHub ee04abe797 bench: add remote_spawn benchmark for inject queue contention (#7944) 2026-03-11 10:13:39 +01:00
figsodaandGitHub aa1e7e2b9d stream: impl FromStream for BTreeSet (#7954) 2026-03-09 10:20:21 +00:00
ADD-SPandGitHub 961757f548 ci: freeze rustc on 1.93.1 (#7961) 2026-03-09 07:43:48 +01:00
Carl LercheandGitHub e67cd87f71 chore: link to tokioconf.com (#7953) 2026-03-06 12:00:42 -08:00
winlogonandGitHub a502d1b5c8 loom: remove StaticAtomicU64 (#7902) 2026-03-04 16:16:50 +01:00
ADD-SPandGitHub 0273e45ead chore: prepare Tokio v1.50.0 (#7934) tokio-1.50.0 2026-03-03 10:39:42 +01:00
ADD-SPandGitHub e3ee4e58dc chore: prepare tokio-macros v2.6.1 (#7943) tokio-macros-2.6.1 2026-03-02 19:17:41 +01:00
Evan CameronandGitHub 8c980ea75a io: add write_all_vectored to tokio-util (#7768) 2026-02-27 11:16:43 +01:00
Mattia PitossiandGitHub e35fd6d6b7 ci: fix patch during clippy step (#7935)
* fix the ci issue

* fix readme

* fix ci
2026-02-27 09:40:05 +02:00
LIParadiseandGitHub 03fe44c103 runtime: fix event_interval doc (#7932) 2026-02-24 16:30:53 +01:00
ADD-SPandGitHub d18e5dfbb0 io: fix race in Mock::poll_write (#7882) 2026-02-23 20:49:37 -08:00