4157 Commits

Author SHA1 Message Date
James Kay
4b96af6040
macros: add "local" runtime flavor (#7375) 2025-07-28 13:59:00 +02:00
tkoyasak
ce41896f8d
sync: fix broken link of Python asyncio.Event in SetOnce docs (#7485) 2025-07-27 08:28:24 +08:00
tkoyasak
c8ab78a84f
changelog: fix incorrect PR number for 1.47.0 (#7484) 2025-07-27 08:24:09 +08:00
Daksh
3911cb8523
chore: prepare Tokio v1.47.0 (#7482) tokio-1.47.0 2025-07-26 16:50:58 +02:00
Aria Andika
d545aa2601
sync: add sync::Notify::notified_owned() (#7465) 2025-07-26 21:45:34 +08:00
Daksh
911ab21d70
sync: add SetOnce (#7418) 2025-07-25 10:29:14 +02:00
Conrad Ludgate
9e94fa7e15
task: remove raw-entry feature from hashbrown dep (#7252) 2025-07-22 15:52:54 +02:00
Qi
0d234c3cf9
ci: unfreeze wasm-unknown-unknown from rustc 1.81 (#7471)
Signed-off-by: ADD-SP <qiqi.zhang@konghq.com>
Co-authored-by: Taiki Endo <te316e89@gmail.com>
2025-07-21 09:48:04 +08:00
Taiki Endo
3754e059b6
ci: use ubuntu-24.04-arm instead of ubuntu-22.04-arm (#7470) 2025-07-20 17:19:26 +09:00
Stepan Tubanov
6d868d96ce
sync: fix CancellationToken failing to cancel the ready futures (#7462)
This patch fixes an issue where the `CancellationToken::run_until_cancelled` never cancels the `Future` that returns `Ready` at the first `poll`.

---------

Co-authored-by: Luca BRUNO <lucab@lucabruno.net>
2025-07-20 10:03:29 +08:00
Qi
0a3fe46086
sync: remove duplicated code in OnceCell tests (#7458)
Signed-off-by: ADD-SP <qiqi.zhang@konghq.com>
2025-07-14 10:28:02 +02:00
Qi
154d7d5fe6
ci: cleanup legacy R-loom-multi-thread-alt label from the labeler (#7457)
Signed-off-by: ADD-SP <qiqi.zhang@konghq.com>
2025-07-12 16:37:21 +02:00
Pepijn Van Eeckhoudt
611b793356
coop: add cooperative and poll_proceed (#7405) 2025-07-11 08:07:44 +00:00
Jess Izen
888ee60e41
metrics: properly annotate required features for 64-bit-only metrics (#7449) 2025-07-09 15:03:22 +02:00
Qi
7dd4d8a30e
runtime: cleanup legacy tests of alt multi-threaded runtime (#7451)
Signed-off-by: ADD-SP <qiqi.zhang@konghq.com>
2025-07-09 19:52:33 +08:00
Orson Peters
085e616c87
sync: use swap in AtomicWaker::wake (#7450) 2025-07-09 10:09:34 +00:00
Aaron Chen
a7896d07f1
chore: update CI to clippy 1.88 (#7452) 2025-07-09 08:34:24 +02:00
Erich Gubler
aff24dfbeb
deps: upgrade windows-sys from 0.52 to 0.59 (#7117) 2025-07-07 17:49:12 +00:00
Thomas de Zeeuw
71cc9ab4c2
deps: update to socket2 v0.6 (#7443) 2025-07-07 13:45:30 +02:00
Qi
02cbe4591b
runtime: improve safety comments of Readiness<'_> (#7415)
Signed-off-by: ADD-SP <qiqi.zhang@konghq.com>
Co-authored-by: Eliza Weisman <eliza@buoyant.io>
Co-authored-by: Alice Ryhl <aliceryhl@google.com>
2025-07-07 19:04:08 +08:00
Motoyuki Kimura
0783797520
runtime: fix handling of cancelled io_uring Ops (#7436) 2025-07-05 10:41:37 +02:00
Eliza Weisman
ab3ff69cf2
chore: prepare to release v1.46.1 (#7444)
# 1.46.1 (July 4th, 2025)

This release fixes incorrect spawn locations in runtime task hooks for tasks
spawned using `tokio::spawn` rather than `Runtime::spawn`. This issue only
effected the spawn location in `TaskMeta::spawned_at`, and did not effect task
locations in Tracing events.

## Unstable

- runtime: add `TaskMeta::spawn_location` tracking where a task was spawned
  ([#7440)])

[#7440]: https://github.com/tokio-rs/tokio/pull/7440
tokio-1.46.1
2025-07-04 19:27:35 +00:00
Eliza Weisman
a0d5b8ab30
runtime(unstable): fix task hook spawn locations for tokio::spawn (#7440)
## Motivation

Unfortunately, due to an oversight on my part, the capturing of spawn
locations was only tested with the `Runtime::spawn` method, and *not*
with `tokio::spawn`/`tokio::task::spawn`, which is how most tasks are
spawned in Real Life. And, it turned out that because this was not
tested...well, it was broken. Agh. My bad.

## Solution

Although the whole call chain for spawning tasks using `tokio::spawn`
was correctly annotated with `#[track_caller]`, the location wasn't
propagated correctly because of the `context::with_current(|handle| {
... })` closure that accesses the current runtime. Because the call to
spawn the task occurs inside a closure, the *closure*'s location is
captured instead of the caller. This means any task spawned by
`tokio::spawn` records its location as being in
`tokio/src/task/spawn.rs`, which is not what we'd like. This commit
fixes that by capturing the spawn location outside the `with_current`
closure and passing it in explicitly.

I've updated the tests to also spawn a task with `tokio::spawn`, so that
we ensure this works correctly.
2025-07-04 09:25:40 -07:00
shangchenglumetro
a1ee3ef218
chore: fix some minor typos in the comments (#7442)
Signed-off-by: shangchenglumetro <shuang.cui@live.com>
2025-07-04 11:29:27 +02:00
Alice Ryhl
171cd148a3
changelog: fix typo in pipe::OpenOptions for 1.46.0 (#7439) 2025-07-02 09:27:11 +00:00
Eliza Weisman
3f1f268583
chore: prepare Tokio v1.46.0 (#7437) tokio-1.46.0 2025-07-02 10:20:42 +02:00
Eliza Weisman
3e890cc017
rt(unstable): add spawn Location to TaskMeta (#7417)
As described in issue #7411, task spawning APIs are currently annotated
with `#[track_caller]`, allowing us to capture the location in the user
source code where the task was spawned. This is used for `tracing`
events used by `tokio-console` and friends. However, this information is
*not* exposed to the runtime `on_task_spawn`, `on_before_task_poll`,
`on_after_task_poll`, and `on_task_terminate` hooks, which is a shame,
as it would be useful there as well.

This branch adds the task's spawn location to the `TaskMeta` struct
provided to the runtime's task hooks. This is implemented by storing a
`&'static Location<'static>` in the task's `Core` alongside the
`task::Id`. In [this comment][1], @ADD-SP suggested storing the
`Location` in the task's `Trailer`.

I opted to store it in the `Core` instead, as the `Trailer` is intended
to store "cold" data that is only accessed when the task _completes_,
and not on every poll. Since the task meta is passed to the
`on_before_task_poll` and `on_after_task_poll` hooks, we would be
accessing the `Trailer` on polls if we stored the `Location` there.
Therefore, I put it in the `Core`, instead, which contains data that we
access every time the task is polled.

Closes #7411

[1]: https://github.com/tokio-rs/tokio/issues/7411#issuecomment-2993377045
2025-06-30 18:13:42 +00:00
xumaple
69290a6432
net: derive Clone for net::unix::SocketAddr (#7422) 2025-06-30 15:31:04 +02:00
Alice Ryhl
e2b175848b
fuzz: cfg fuzz tests under cfg(test) (#7428) 2025-06-30 10:24:10 +02:00
GarmashAlex
b7a75b5be3
net: update AsRawFd doc link to current Rust stdlib location (#7429) 2025-06-27 14:08:31 +00:00
Marshall Pierce
6b705b3053
net: allow pipe::OpenOptions::read_write on Android (#7426) 2025-06-27 09:39:55 +02:00
VolodymyrBg
3636fd018a
net: fix broken link of RawFd in TcpSocket docs (#7416) 2025-06-24 21:15:39 +08:00
Alice Ryhl
2506c9fa99
benches: revert "properly gate unix benches" (#7412)
This reverts commit 933fa498d0bda193960784cb3f6a47be3bc1e492.
2025-06-21 14:52:04 +02:00
Qi
b3a14483bf
sync: improve docs of tokio_util::sync::CancellationToken (#7408)
Co-authored-by: Alice Ryhl <aliceryhl@google.com>
2025-06-19 06:32:41 +08:00
Qi
013f323def
docs: add a missing panic scenario of time::advance (#7394) 2025-06-18 20:25:12 +08:00
yanyuxing
b926700065
sync: add DropGuardRef for CancellationToken (#7407) 2025-06-18 10:25:41 +02:00
Alice Ryhl
99a03a502e
runtime: add thread_park_ok test (#7402) 2025-06-16 09:49:00 +02:00
Tim Vilgot Mikael Fredenberg
933fa498d0
benches: properly gate unix benches (#7392) 2025-06-11 10:07:34 +02:00
Motoyuki Kimura
9f848c9f54
rt: add check for io_uring availability at runtime (#7357) 2025-06-11 03:26:23 +09:00
Geoffry Song
912b862a05
task: add AbortOnDropHandle::detach (#7400) 2025-06-10 09:35:48 +02:00
Qi
714e5b571f
runtime: move impl Schedule for Arc<Handle> (#7398) 2025-06-09 09:32:59 +02:00
Jess Izen
8e999e3806
macros: add biased mode to join! and try_join! (#7307) 2025-06-09 09:31:05 +02:00
Oliver E. Anderson
1d980145cb
io: document cancellation safety of AsyncWriteExt::flush (#7364) 2025-06-08 20:57:36 +02:00
Alice Ryhl
8259133ca0
task: disallow blocking in LocalSet::{poll,drop} (#7372) 2025-06-08 20:56:55 +02:00
Yuyi Wang
38d88c6799
net: add cygwin support (#7393) 2025-06-08 09:55:43 +02:00
Austin Bonander
c38de96b94
sync: add same_channel analogue to OwnedPermit (#7389) 2025-06-07 13:10:48 +02:00
tiif
2440d113ff
ci: enable tests using fcntl in miri (#7382) 2025-06-04 09:55:27 +02:00
Maximilian Hubert
ab8d7b82a1
readme: fix double period in reactor description (#7363) 2025-05-28 21:24:53 +02:00
Qi
9563707aaa
time: cumulative minor improvements (#7358) 2025-05-28 14:01:31 +02:00
Jeff Vander Stoep
193c1574a1
examples: update rand crate to 0.9.1 (#7371) 2025-05-28 11:32:24 +00:00