Commit Graph
4613 Commits
Author SHA1 Message Date
MildlyMeticulous d87d860cc8 codec: optimize buffer reserve for LengthDelimitedCodec::encode (#8333)
The reservation used `n`, the length after `length_adjustment` has been
applied, but the encoder goes on to write `length_field_len` bytes of
header plus `data.len()` bytes of payload. A positive `length_adjustment`
therefore under-reserved by exactly the adjustment on every frame, and a
negative one over-reserved, so the reservation did not match the write in
either of the adjusted configurations shown in the module docs.
2026-08-09 16:47:16 +02:00
Minh Vu ed25636141 time: wake DelayQueue when cleared (#8320) 2026-08-09 16:45:35 +02:00
Minh Vu 7f86b2ace5 codec: clamp runtime frame length to field width (#8275) 2026-08-09 16:39:18 +02:00
Russell Cohen 6b62ac48ed runtime: expose schedule latency in task hooks (#8282)
Add an explicit tracking knob and expose the sampled task schedule
latency through TaskMeta. Reuse the histogram poll timestamp where
possible and preserve grouped histogram accounting for LIFO polls.

Document activation and interval semantics and cover current-thread,
multi-thread, LIFO, disabled, and non-poll callback behavior.
2026-08-09 14:38:39 +00:00
Thomas Zander ecd621dd2c net: support ucred.rs on Fuchsia (#8257)
In order to compile successfully with the net feature on Fuchsia, a cfg
attribute for Fuchsia in `impl_noproc` is required.
2026-08-07 17:42:19 +02:00
kai-xlr 4f7b8d6239 fs: document cancellation behavior of tokio::fs (#8265) 2026-08-07 22:14:05 +08:00
MAAZIZ Adel Ayoub a5b2d1ff69 tokio-util: stop polling StreamReader after EOF (#8332) 2026-08-07 21:59:51 +08:00
Tim Vilgot Mikael Fredenberg cc8c053421 tokio: simplify Option handling with idiomatic combinators (#8336) 2026-08-07 21:18:39 +08:00
Minh Vu dd344a550c io: complete zero-length memory stream operations (#8323) 2026-08-06 12:01:12 +02:00
Alex Gaynor 108d6d3dc0 runtime: refactor the spawn blocking queue to make adding a new sharded implementation easy (#8135) 2026-07-31 22:27:54 +02:00
Motoyuki Kimura adc2ae7af2 rt: add error documentation for runtime::Builder (#8297) 2026-07-30 12:29:09 +02:00
Geoffry Song dc48a05132 runtime: move block_in_place setup into a non-generic function (#8315) 2026-07-30 11:05:04 +02:00
Dirkjan Ochtman 4308c74a65 chore: prepare tokio-macros v2.7.2 (#8330) 2026-07-29 15:14:27 +02:00
Joel Dice 1a2dbbaa21 net: enable various tests for WASI (#8313)
These tests were temporarily disabled until required `wasi-libc` fixes made
their way into a Rust release.  Now that that has happened, we can enable them.

Note that `send_to_recv_closed_returns_err` remains disabled for a bit longer.
The applicable `wasi-libc` bug was masking a separate bug in Wasmtime, fixed
[here](https://github.com/bytecodealliance/wasmtime/pull/13933).  Once that fix
makes its way into a release (presumably v48.0.0), we'll finally be able enable
that test, and that should be the last of the
temporarily-disabled-on-WASI-due-to-bugs tests.
2026-07-28 11:38:34 +02:00
K-tecchan df28ffe61d rt: correct tick to tick_op in set_readiness internal docs (#8322) 2026-07-27 08:11:09 +02:00
Paolo Barbolini 6a058770e9 macros: upgrade syn to v3 (#8304) 2026-07-26 11:26:19 +00:00
Alice Ryhl 818e2dd866 time: adjust tests::time_rt::tickspace (#8318) 2026-07-25 22:09:09 +02:00
Tim Vilgot Mikael Fredenberg 460dc16d19 tokio-test: fix semicolon_in_expressions_from_macros lint (#8317) 2026-07-25 19:39:39 +02:00
dependabot[bot]dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>Mattia Pitossi
2120bee47f ci: bump actions/labeler from 6 to 7 (#8316)
Bumps [actions/labeler](https://github.com/actions/labeler) from 6 to 7.
- [Release notes](https://github.com/actions/labeler/releases)
- [Commits](https://github.com/actions/labeler/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/labeler
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mattia Pitossi <[email protected]>
2026-07-23 06:31:42 +00:00
kai-xlr d1d639fbe8 docs: add step-by-step workflow in contributing guidelines (#3865) (#8306) 2026-07-23 08:00:51 +02:00
Joel Dice 5760ccdc37 ci: pin Wasmtime version(s) in CI (#8314)
Per https://github.com/bytecodealliance/wasmtime/pull/13558, Wasmtime v46.0.1
was the last release to support `wasm32-wasip1-threads`, so we use that for the
WASIp1 testing.

For WASIp2, we should be able to use any recent version of Wasmtime, but we pin
to a specific version anyway to avoid surprises.
2026-07-23 07:57:22 +02:00
Alice Ryhl bc0933ccff chore: prepare tokio-stream v0.1.19 (#8310) tokio-stream-0.1.19 2026-07-22 09:49:29 +02:00
Alex Touchet e3786d0090 readme: remove obsolete TokioConf notices (#8311) 2026-07-22 07:36:16 +00:00
Alice Ryhl f2189d3bd6 chore: prepare tokio-util v0.7.19 (#8309) tokio-util-0.7.19 2026-07-21 14:09:36 +02:00
Joel Dice 52f2745c18 net: re-enable tcp_stream::try_read_buf test for WASI (#8305) 2026-07-21 10:12:54 +02:00
Mattia Pitossi ac6869a431 rt: remove unstable cfgs leftovers after local runtime stabilization (#8298) 2026-07-20 20:12:30 +02:00
ADD-SP 75fef53d0a chore: prepare Tokio v1.53.1 (#8303) tokio-1.53.1 2026-07-20 19:05:08 +02:00
Jens Holdgaard Pedersen ae9d011213 signal: restore MSRV by removing OnceLock::wait from the Windows handler (#8300)
OnceLock::wait was stabilized in Rust 1.86, so its use in the Windows
console ctrl handler broke tokio's declared rust-version of 1.71 on
windows targets in 1.53.0 (any cargo check with a 1.71..1.86 toolchain
fails with E0599).

The wait existed only because SetConsoleCtrlHandler was called inside
REGISTRY's get_or_init closure, i.e. before the OnceLock was actually
initialized, leaving a window where an invoked handler could observe an
uninitialized REGISTRY. Initialize the registry first and register the
OS handler afterwards (exactly once, through a second OnceLock that
also caches a registration failure so every subsequent call reports the
same error, matching the previous behavior). The handler can then rely
on plain get(): registration happens-after initialization, so an
invoked handler always finds the registry.

Verified with cargo +1.71 check -p tokio --features full
--target x86_64-pc-windows-msvc (fails with the reported E0599 before
this change, clean after) and --all-targets on stable for the same
target.

Fixes #8299
2026-07-20 19:04:08 +02:00
ADD-SP eb4988dc2e time: fix the loom test of the race between cancellation/insertion (#8302) 2026-07-20 19:10:31 +08:00
Alexander KireyevandADD-SP 91d3b4c0bc time: fix alt timer cancellation and insertion race (#8252)
Co-authored-by: ADD-SP <[email protected]>
2026-07-20 18:32:46 +08:00
K-tecchan a46338401b runtime: remove dead link definition in Runtime::block_on (#8301) 2026-07-20 13:47:27 +08:00
Alice Ryhl be689a35f5 chore: prepare Tokio v1.53.0 (#8294) tokio-1.53.0 2026-07-17 10:12:50 +02:00
Alice Ryhl 50f76c71ec chore: prepare tokio-macros v2.7.1 (#8295) tokio-macros-2.7.1 2026-07-17 10:12:38 +02:00
Alice Ryhl f61fccad3c Merge 'tokio-1.52.4' into 'master' (#8290) 2026-07-16 13:27:30 +00:00
Alice Ryhl efdba5fcf0 chore: prepare Tokio v1.52.4 (#8289) tokio-1.52.4 2026-07-16 15:23:48 +02:00
Alice Ryhl b0ba02e755 Merge 'tokio-1.51.4' into 'tokio-1.52.x' (#8288) 2026-07-16 12:18:21 +00:00
Alice Ryhl 7bcd2d343d taskdump: remove crate disambiguators from output (#8288) 2026-07-16 12:17:13 +00:00
Alice Ryhl f84b209126 chore: prepare Tokio v1.51.4 (#8286) tokio-1.51.4 2026-07-16 13:59:24 +02:00
Amey Pawar eacb98e189 runtime: don't skip the driver when before_park schedules work (#8222) 2026-07-16 13:16:47 +02:00
Minh Vu 5e16ee00fa task: avoid replacing the JoinQueue waker in try_join_next (#8279)
Do not poll pending join handles with a noop waker, since that can replace the waker registered by poll_join_next and leave its caller asleep.
2026-07-16 13:15:11 +02:00
cong-or 88212ab64a sync: document memory ordering guarantees for Semaphore (#8119) 2026-07-16 09:43:52 +02:00
kai-xlr 9cae638de6 examples: add UDP binding to all interfaces docs (#8283)
Closes #6737
2026-07-15 17:05:27 +00:00
Tobias Bucher 315a320e96 io: fix typo in SimplexStream docs (#8284) 2026-07-15 16:51:52 +00:00
MAAZIZ Adel Ayoub dac81bf8c8 sync: wake mpsc receiver when a queued reserve[_many] returns permits (#8260) 2026-07-14 09:56:18 +02:00
Minh Vu 145f124d98 ci: preserve QEMU exit status in uring kernel tests (#8271) 2026-07-14 09:52:32 +02:00
Minh Vu 6e8475dd60 time: wake DelayQueue after resetting to expired (#8274)
Resetting an item into the expired stack bypassed the existing Sleep reset
path, leaving a pending consumer asleep until an unrelated deadline.
2026-07-14 09:33:59 +02:00
Mattia Pitossi b6f30cae9a rt: flush CQE in case of CQE overflow (#8277) 2026-07-13 19:33:23 +08:00
Rachit2323 4638b65f9c stream: implement Peekable::size_hint (#8109) 2026-07-13 13:00:59 +02:00
kai-xlr fe258f5e6d net: use getpeereid for QNX peer credentials (#8270)
QNX (nto) does not provide LOCAL_PEEREID, which is used by the
impl_netbsd module. This causes a compilation failure on QNX.

Use getpeereid() instead, following the same pattern as impl_dragonfly
and impl_aix. This provides uid/gid but not pid, so UCred::pid()
returns None on QNX.
2026-07-13 12:36:10 +02:00
kai-xlr 33f46a5395 io: add warning about stdout reordering with multiple handles (#8276) 2026-07-12 21:12:48 +08:00