]> git.feebdaed.xyz Git - 0xmirror/tokio.git/log
0xmirror/tokio.git
3 months agonet: clarify the supported platform of `set_reuseport()` and `reuseport()` (#7628)
Vaibhav Gupta [Wed, 17 Sep 2025 13:10:10 +0000 (18:40 +0530)]
net: clarify the supported platform of `set_reuseport()` and `reuseport()` (#7628)

3 months agoruntime: clarify the edge case of `Builder::global_queue_interval()` (#7605)
Martin Grigorov [Tue, 16 Sep 2025 13:41:18 +0000 (16:41 +0300)]
runtime: clarify the edge case of `Builder::global_queue_interval()` (#7605)

3 months agosync: improve the docs of `sync::watch` (#7601)
Martin Grigorov [Mon, 15 Sep 2025 11:56:29 +0000 (14:56 +0300)]
sync: improve the docs of `sync::watch` (#7601)

Co-authored-by: Alice Ryhl <aliceryhl@google.com>
3 months agoexamples: bump `http` crate from `0.2` to `1` (#7618)
tottoto [Mon, 15 Sep 2025 10:22:57 +0000 (19:22 +0900)]
examples: bump `http` crate from `0.2` to `1` (#7618)

3 months agotask: clarify the task ID reuse guarantees (#7577)
Sean Oxley [Mon, 15 Sep 2025 10:18:16 +0000 (19:18 +0900)]
task: clarify the task ID reuse guarantees (#7577)

3 months agoutil: fix `pending_only_on_first_poll_with_cancellation_token_owned_test` to use...
Martin Grigorov [Mon, 15 Sep 2025 07:22:42 +0000 (10:22 +0300)]
util: fix `pending_only_on_first_poll_with_cancellation_token_owned_test` to use an owned cancellation token (#7613)

The name of the test suggests that it should test the
with_cancellation_token_owned() extension method

3 months agonet: clarify the behavior of `UCred::pid()` on Cygwin (#7611)
Martin Grigorov [Sun, 14 Sep 2025 16:05:05 +0000 (19:05 +0300)]
net: clarify the behavior of `UCred::pid()` on Cygwin (#7611)

3 months agotokio: fix minor errors in `tokio/CHANGELOG.md` (#7608)
Martin Grigorov [Thu, 11 Sep 2025 10:02:34 +0000 (13:02 +0300)]
tokio: fix minor errors in `tokio/CHANGELOG.md` (#7608)

3 months agotime: add `#[track_caller]` to `FutureExt::timeout` (#7588)
Martin Grigorov [Thu, 11 Sep 2025 07:18:40 +0000 (10:18 +0300)]
time: add `#[track_caller]` to `FutureExt::timeout` (#7588)

Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>
3 months agonet: fix copy/paste errors in udp peek methods (#7604)
Martin Grigorov [Wed, 10 Sep 2025 14:33:35 +0000 (17:33 +0300)]
net: fix copy/paste errors in udp peek methods (#7604)

3 months agotask: remove duplicated code in `JoinMap::remove_by_id` (#7603)
Martin Grigorov [Wed, 10 Sep 2025 14:16:15 +0000 (17:16 +0300)]
task: remove duplicated code in `JoinMap::remove_by_id` (#7603)

3 months agotask: improve the example of `poll_proceed` (#7586)
Qi [Wed, 10 Sep 2025 12:57:03 +0000 (20:57 +0800)]
task: improve the example of `poll_proceed` (#7586)

Signed-off-by: ADD-SP <qiqi.zhang@konghq.com>
3 months agoio: export `Chain` of `AsyncReadExt::chain` (#7599)
Aatif Syed [Wed, 10 Sep 2025 08:45:42 +0000 (09:45 +0100)]
io: export `Chain` of `AsyncReadExt::chain` (#7599)

3 months agofs: fill the destination buffer with 0s for MockFile::read() (#7596)
Martin Grigorov [Wed, 10 Sep 2025 08:41:20 +0000 (11:41 +0300)]
fs: fill the destination buffer with 0s for MockFile::read() (#7596)

3 months agomacros: Update the version used for Git tag sample for release steps (#7598)
Martin Grigorov [Tue, 9 Sep 2025 13:52:58 +0000 (16:52 +0300)]
macros: Update the version used for Git tag sample for release steps (#7598)

Change 1.x.y to x.y.z so that it does not become obsolete again when
tokio-macros 3.x is released

3 months agomacros: add missing `local` flavor to `tokio::main` error message (#7597)
Martin Grigorov [Tue, 9 Sep 2025 13:26:16 +0000 (16:26 +0300)]
macros: add missing `local` flavor to `tokio::main` error message (#7597)

3 months agotest: add tests for time in wasm32-unknown-unknown (#7510)
unvalley [Tue, 9 Sep 2025 10:31:14 +0000 (19:31 +0900)]
test: add tests for time in wasm32-unknown-unknown (#7510)

3 months agosync: reword allocation failure paragraph in broadcast docs (#7595)
Martin Grigorov [Tue, 9 Sep 2025 09:05:14 +0000 (12:05 +0300)]
sync: reword allocation failure paragraph in broadcast docs (#7595)

3 months agofs: preserve `max_buf_size` when cloning a `File` (#7593)
Martin Grigorov [Tue, 9 Sep 2025 08:34:35 +0000 (11:34 +0300)]
fs: preserve `max_buf_size` when cloning a `File` (#7593)

3 months agofs: add `File::max_buf_size` (#7594)
Martin Grigorov [Tue, 9 Sep 2025 08:12:07 +0000 (11:12 +0300)]
fs: add `File::max_buf_size` (#7594)

3 months agosync: fix implementation of unused `RwLock::try_*` methods (#7587)
Martin Grigorov [Tue, 9 Sep 2025 07:39:01 +0000 (10:39 +0300)]
sync: fix implementation of unused `RwLock::try_*` methods (#7587)

bd4ccae184b0359cb88f9ebc2ba157867e1eee0e introduced a wrapper for the
RwLock to get rid of poisoning aspects.

By mistake (?!) its try_read/write methods actually delegate to
read/write() and this would lead to blocking

Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>
3 months agoreadme: fix the version used as an example how to use the latest minor of LTS (#7592)
Martin Grigorov [Tue, 9 Sep 2025 07:37:47 +0000 (10:37 +0300)]
readme: fix the version used as an example how to use the latest minor of LTS (#7592)

3 months agoci: remove the job `test-pass` (#7575)
Qi [Mon, 8 Sep 2025 10:07:40 +0000 (18:07 +0800)]
ci: remove the job `test-pass` (#7575)

Signed-off-by: ADD-SP <qiqi.zhang@konghq.com>
3 months agoio: fix typos in the docs of `AsyncFd` readiness guards (#7583)
Martin Grigorov [Sat, 6 Sep 2025 07:58:41 +0000 (10:58 +0300)]
io: fix typos in the docs of `AsyncFd` readiness guards (#7583)

Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>
3 months agoexamples: fix the write length in the `connect-tcp` example (#7581)
Martin Grigorov [Sat, 6 Sep 2025 07:49:07 +0000 (10:49 +0300)]
examples: fix the write length in the `connect-tcp` example (#7581)

Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>
3 months agoexamples: update outdated example name `connect` to `connect-tcp` (#7582)
Martin Grigorov [Sat, 6 Sep 2025 06:01:40 +0000 (09:01 +0300)]
examples: update outdated example name `connect` to `connect-tcp` (#7582)

Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>
3 months agoprocess: fix unit test for trailing LF in `uname -r` (#7579)
Martin Grigorov [Sat, 6 Sep 2025 05:52:16 +0000 (08:52 +0300)]
process: fix unit test for trailing LF in `uname -r` (#7579)

Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>
3 months agoio: clarify the zero capacity case of `AsyncRead::poll_read` (#7580)
Martin Grigorov [Sat, 6 Sep 2025 05:42:35 +0000 (08:42 +0300)]
io: clarify the zero capacity case of `AsyncRead::poll_read` (#7580)

Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>
3 months agostream: improve the the docs of `TcpListenerStream` (#7578)
Martin Grigorov [Sat, 6 Sep 2025 05:36:41 +0000 (08:36 +0300)]
stream: improve the the docs of `TcpListenerStream` (#7578)

Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>
3 months agosync: use `UnsafeCell::get_mut` in `Mutex::get_mut` and `RwLock::get_mut` (#7569)
Roman [Thu, 4 Sep 2025 14:39:28 +0000 (11:39 -0300)]
sync: use `UnsafeCell::get_mut` in `Mutex::get_mut` and `RwLock::get_mut` (#7569)

3 months agonet: implement `AsRef<Self>` for `TcpStream` and `UnixStream` (#7573)
Aatif Syed [Thu, 4 Sep 2025 10:31:49 +0000 (11:31 +0100)]
net: implement `AsRef<Self>` for `TcpStream` and `UnixStream` (#7573)

3 months agosync: remove inner mutex in `SetOnce` (#7554)
Sam [Wed, 3 Sep 2025 15:37:50 +0000 (16:37 +0100)]
sync: remove inner mutex in `SetOnce` (#7554)

3 months agocodec: add `{FramedRead,FramedWrite}::into_parts()` (#7566)
Varun Doshi [Wed, 3 Sep 2025 11:38:51 +0000 (17:08 +0530)]
codec: add `{FramedRead,FramedWrite}::into_parts()` (#7566)

3 months agotime: clarify the cancellation safety of the `DelayQueue` (#7564)
Daniel Sharifi [Sun, 31 Aug 2025 12:57:17 +0000 (12:57 +0000)]
time: clarify the cancellation safety of the `DelayQueue` (#7564)

4 months agotime: reduce the generated code size of `Timeout<T>::poll` (#7535)
Alex Bakon [Tue, 19 Aug 2025 11:42:55 +0000 (07:42 -0400)]
time: reduce the generated code size of `Timeout<T>::poll` (#7535)

4 months agotask: implement `Ord` for `task::Id` (#7530)
Asger Hautop Drewsen [Fri, 15 Aug 2025 07:52:12 +0000 (09:52 +0200)]
task: implement `Ord` for `task::Id` (#7530)

4 months agonet: qualify that `SO_REUSEADDR` is only set on Unix (#7533)
Logan Praneis [Thu, 14 Aug 2025 01:25:55 +0000 (20:25 -0500)]
net: qualify that `SO_REUSEADDR` is only set on Unix (#7533)

4 months agoci: update GitHub actions/checkout to v5 (#7529)
CrazyFrog [Wed, 13 Aug 2025 10:57:45 +0000 (12:57 +0200)]
ci: update GitHub actions/checkout to v5 (#7529)

4 months agonet: clarify socket gets closed on drop (#7526)
Noam Soloveichik [Mon, 11 Aug 2025 16:26:01 +0000 (19:26 +0300)]
net: clarify socket gets closed on drop (#7526)

4 months agoci: remove a typo from `spellcheck.dic` (#7524)
Qi [Sun, 10 Aug 2025 12:31:09 +0000 (20:31 +0800)]
ci: remove a typo from `spellcheck.dic` (#7524)

Signed-off-by: ADD-SP <qiqi.zhang@konghq.com>
4 months agoruntime: fix a typo in comment of `MAX_LIFO_POLLS_PER_TICK` (#7520)
mxsm [Sat, 9 Aug 2025 14:29:43 +0000 (22:29 +0800)]
runtime: fix a typo in comment of `MAX_LIFO_POLLS_PER_TICK` (#7520)

4 months agoci: pin the rust version for wasm tests (#7518)
Motoyuki Kimura [Fri, 8 Aug 2025 10:09:31 +0000 (19:09 +0900)]
ci: pin the rust version for wasm tests (#7518)

4 months agotask: inline the docs of `TaskTracker` while re-exporting it (#7516)
Qi [Fri, 8 Aug 2025 07:54:25 +0000 (15:54 +0800)]
task: inline the docs of `TaskTracker` while re-exporting it (#7516)

Signed-off-by: ADD-SP <qiqi.zhang@konghq.com>
4 months agofs: add io_uring `open` operation (#7321)
Motoyuki Kimura [Fri, 8 Aug 2025 07:51:42 +0000 (16:51 +0900)]
fs: add io_uring `open` operation (#7321)

4 months agonet: render the `cygwin` in the docs of `quickack` and `set_quickack` (#7515)
Qi [Wed, 6 Aug 2025 01:01:27 +0000 (09:01 +0800)]
net: render the `cygwin` in the docs of `quickack` and `set_quickack` (#7515)

Signed-off-by: ADD-SP <qiqi.zhang@konghq.com>
4 months agofuture: clarify the fairness of `FutureExt` for cancellation adapters (#7512)
Luca Bruno [Mon, 4 Aug 2025 13:26:11 +0000 (15:26 +0200)]
future: clarify the fairness of `FutureExt` for cancellation adapters (#7512)

This fixes the docstrings on `FutureExt` so that the bias and fairness
notes are correct and consistent in all cases.
All cancellation-related wrappers are biased towards the completion of
the inner future, but they do initially check if the token is
already cancelled at construction time.

4 months agoci: fix clippy warnings triggered under specific cfg (#7495)
Motoyuki Kimura [Mon, 4 Aug 2025 10:36:17 +0000 (19:36 +0900)]
ci: fix clippy warnings triggered under specific cfg (#7495)

4 months agoprocess: upgrade `Command::spawn_with` to use `FnOnce` (#7511)
Michael Zhao [Sun, 3 Aug 2025 18:27:37 +0000 (11:27 -0700)]
process: upgrade `Command::spawn_with` to use `FnOnce` (#7511)

4 months agotask: fix flaky joinmap test during abort (#7509)
Conrad Ludgate [Sun, 3 Aug 2025 18:00:33 +0000 (19:00 +0100)]
task: fix flaky joinmap test during abort (#7509)

4 months agochore: prepare tokio-util v0.7.16 (#7507)
Alice Ryhl [Sun, 3 Aug 2025 09:12:41 +0000 (11:12 +0200)]
chore: prepare tokio-util v0.7.16 (#7507)

4 months agotask: stabilise `JoinMap` (#7075)
Conrad Ludgate [Sun, 3 Aug 2025 07:58:28 +0000 (08:58 +0100)]
task: stabilise `JoinMap` (#7075)

4 months agosync: document cancel safety on `SetOnce::wait` (#7506)
Alice Ryhl [Sun, 3 Aug 2025 07:42:30 +0000 (09:42 +0200)]
sync: document cancel safety on `SetOnce::wait` (#7506)

4 months agocodec: also apply capacity to read buffer in `Framed::with_capacity` (#7500)
Lucas Black [Fri, 1 Aug 2025 19:26:33 +0000 (12:26 -0700)]
codec: also apply capacity to read buffer in `Framed::with_capacity` (#7500)

4 months agoMerge 'tokio-1.47.1' into 'master'
Alice Ryhl [Fri, 1 Aug 2025 11:21:45 +0000 (13:21 +0200)]
Merge 'tokio-1.47.1' into 'master'

4 months agochore: prepare Tokio v1.47.1 (#7504)
Alice Ryhl [Fri, 1 Aug 2025 11:20:34 +0000 (13:20 +0200)]
chore: prepare Tokio v1.47.1 (#7504)

4 months agoMerge 'tokio-1.43.2' into 'tokio-1.47.x' (#7503)
Alice Ryhl [Fri, 1 Aug 2025 10:59:58 +0000 (12:59 +0200)]
Merge 'tokio-1.43.2' into 'tokio-1.47.x' (#7503)

4 months agochore: prepare Tokio v1.43.2 (#7502)
Alice Ryhl [Fri, 1 Aug 2025 10:57:50 +0000 (12:57 +0200)]
chore: prepare Tokio v1.43.2 (#7502)

4 months agoblocking: clarify that spawn_blocking is aborted if not yet started (#7501)
Alice Ryhl [Fri, 1 Aug 2025 10:32:37 +0000 (12:32 +0200)]
blocking: clarify that spawn_blocking is aborted if not yet started (#7501)

4 months agoreadme: add 1.47 as LTS release (#7497)
Alice Ryhl [Thu, 31 Jul 2025 14:45:10 +0000 (16:45 +0200)]
readme: add 1.47 as LTS release (#7497)

(cherry picked from commit ad2e19ffe193b7bce76eab9a51037089da4bc6dc)

4 months agoprocess: fix panic from spurious pidfd wakeup (#7494)
Alice Ryhl [Fri, 1 Aug 2025 09:27:15 +0000 (11:27 +0200)]
process: fix panic from spurious pidfd wakeup (#7494)

4 months agocodec: add `FramedWrite::with_capacity` (#7493)
Lucas Black [Fri, 1 Aug 2025 09:23:22 +0000 (02:23 -0700)]
codec: add `FramedWrite::with_capacity` (#7493)

4 months agoci: add lockfile for LTS branch
Alice Ryhl [Fri, 1 Aug 2025 08:50:10 +0000 (10:50 +0200)]
ci: add lockfile for LTS branch

This is to fix CI failures from backtrace in rustdoc jobs.

4 months agoreadme: add 1.47 as LTS release (#7497)
Alice Ryhl [Thu, 31 Jul 2025 14:45:10 +0000 (16:45 +0200)]
readme: add 1.47 as LTS release (#7497)

4 months agonet: add `TcpStream::quickack` and `TcpStream::set_quickack` (#7490)
Qi [Thu, 31 Jul 2025 11:58:01 +0000 (19:58 +0800)]
net: add `TcpStream::quickack` and `TcpStream::set_quickack` (#7490)

Signed-off-by: ADD-SP <qiqi.zhang@konghq.com>
4 months agoci: add kernel-version-test workflow for io_uring tests (#7486)
Motoyuki Kimura [Thu, 31 Jul 2025 11:52:28 +0000 (20:52 +0900)]
ci: add kernel-version-test workflow for io_uring tests (#7486)

4 months agosync: umplement `Stream::size_hint` for `ReceiverStream` and `UnboundedReceiverStream...
Łukasz Sobczak [Tue, 29 Jul 2025 15:35:09 +0000 (17:35 +0200)]
sync: umplement `Stream::size_hint` for `ReceiverStream` and `UnboundedReceiverStream` (#7492)

4 months agofuture: add adapters of `CancellationToken` for `FutureExt` (#7475)
yanyuxing [Tue, 29 Jul 2025 10:09:13 +0000 (18:09 +0800)]
future: add adapters of `CancellationToken` for `FutureExt` (#7475)

4 months agonet: add `SocketAddr::as_abstract_name` (#7491)
Luca Bruno [Tue, 29 Jul 2025 09:07:58 +0000 (11:07 +0200)]
net: add `SocketAddr::as_abstract_name` (#7491)

4 months agometrics: reorder metrics to be grouped by cfg-gates (#7453)
Jess Izen [Tue, 29 Jul 2025 05:40:57 +0000 (22:40 -0700)]
metrics: reorder metrics to be grouped by cfg-gates (#7453)

5 months agomacros: add "local" runtime flavor (#7375)
James Kay [Mon, 28 Jul 2025 11:59:00 +0000 (12:59 +0100)]
macros: add "local" runtime flavor (#7375)

5 months agosync: fix broken link of Python `asyncio.Event` in `SetOnce` docs (#7485)
tkoyasak [Sun, 27 Jul 2025 00:28:24 +0000 (09:28 +0900)]
sync: fix broken link of Python `asyncio.Event` in `SetOnce` docs (#7485)

5 months agochangelog: fix incorrect PR number for 1.47.0 (#7484)
tkoyasak [Sun, 27 Jul 2025 00:24:09 +0000 (09:24 +0900)]
changelog: fix incorrect PR number for 1.47.0 (#7484)

5 months agochore: prepare Tokio v1.47.0 (#7482)
Daksh [Sat, 26 Jul 2025 14:50:58 +0000 (10:50 -0400)]
chore: prepare Tokio v1.47.0 (#7482)

5 months agosync: add `sync::Notify::notified_owned()` (#7465)
Aria Andika [Sat, 26 Jul 2025 13:45:34 +0000 (20:45 +0700)]
sync: add `sync::Notify::notified_owned()` (#7465)

5 months agosync: add `SetOnce` (#7418)
Daksh [Fri, 25 Jul 2025 08:29:14 +0000 (04:29 -0400)]
sync: add `SetOnce` (#7418)

5 months agotask: remove raw-entry feature from hashbrown dep (#7252)
Conrad Ludgate [Tue, 22 Jul 2025 13:52:54 +0000 (14:52 +0100)]
task: remove raw-entry feature from hashbrown dep (#7252)

5 months agoci: unfreeze wasm-unknown-unknown from rustc 1.81 (#7471)
Qi [Mon, 21 Jul 2025 01:48:04 +0000 (09:48 +0800)]
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>
5 months agoci: use ubuntu-24.04-arm instead of ubuntu-22.04-arm (#7470)
Taiki Endo [Sun, 20 Jul 2025 08:19:26 +0000 (17:19 +0900)]
ci: use ubuntu-24.04-arm instead of ubuntu-22.04-arm (#7470)

5 months agosync: fix `CancellationToken` failing to cancel the ready futures (#7462)
Stepan Tubanov [Sun, 20 Jul 2025 02:03:29 +0000 (06:03 +0400)]
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>
5 months agosync: remove duplicated code in `OnceCell` tests (#7458)
Qi [Mon, 14 Jul 2025 08:28:02 +0000 (16:28 +0800)]
sync: remove duplicated code in `OnceCell` tests (#7458)

Signed-off-by: ADD-SP <qiqi.zhang@konghq.com>
5 months agoci: cleanup legacy `R-loom-multi-thread-alt` label from the labeler (#7457)
Qi [Sat, 12 Jul 2025 14:37:21 +0000 (22:37 +0800)]
ci: cleanup legacy `R-loom-multi-thread-alt` label from the labeler (#7457)

Signed-off-by: ADD-SP <qiqi.zhang@konghq.com>
5 months agocoop: add `cooperative` and `poll_proceed` (#7405)
Pepijn Van Eeckhoudt [Fri, 11 Jul 2025 08:07:44 +0000 (10:07 +0200)]
coop: add `cooperative` and `poll_proceed` (#7405)

5 months agometrics: properly annotate required features for 64-bit-only metrics (#7449)
Jess Izen [Wed, 9 Jul 2025 13:03:22 +0000 (06:03 -0700)]
metrics: properly annotate required features for 64-bit-only metrics (#7449)

5 months agoruntime: cleanup legacy tests of alt multi-threaded runtime (#7451)
Qi [Wed, 9 Jul 2025 11:52:33 +0000 (19:52 +0800)]
runtime: cleanup legacy tests of alt multi-threaded runtime (#7451)

Signed-off-by: ADD-SP <qiqi.zhang@konghq.com>
5 months agosync: use `swap` in `AtomicWaker::wake` (#7450)
Orson Peters [Wed, 9 Jul 2025 10:09:34 +0000 (12:09 +0200)]
sync: use `swap` in `AtomicWaker::wake` (#7450)

5 months agochore: update CI to clippy 1.88 (#7452)
Aaron Chen [Wed, 9 Jul 2025 06:34:24 +0000 (14:34 +0800)]
chore: update CI to clippy 1.88 (#7452)

5 months agodeps: upgrade `windows-sys` from 0.52 to 0.59 (#7117)
Erich Gubler [Mon, 7 Jul 2025 17:49:12 +0000 (13:49 -0400)]
deps: upgrade `windows-sys` from 0.52 to 0.59 (#7117)

5 months agodeps: update to socket2 v0.6 (#7443)
Thomas de Zeeuw [Mon, 7 Jul 2025 11:45:30 +0000 (13:45 +0200)]
deps: update to socket2 v0.6 (#7443)

5 months agoruntime: improve safety comments of `Readiness<'_>` (#7415)
Qi [Mon, 7 Jul 2025 11:04:08 +0000 (19:04 +0800)]
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>
5 months agoruntime: fix handling of cancelled io_uring Ops (#7436)
Motoyuki Kimura [Sat, 5 Jul 2025 08:41:37 +0000 (17:41 +0900)]
runtime: fix handling of cancelled io_uring Ops (#7436)

5 months agochore: prepare to release v1.46.1 (#7444)
Eliza Weisman [Fri, 4 Jul 2025 19:27:35 +0000 (12:27 -0700)]
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

5 months agoruntime(unstable): fix task hook spawn locations for `tokio::spawn` (#7440)
Eliza Weisman [Fri, 4 Jul 2025 16:25:40 +0000 (09:25 -0700)]
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.

5 months agochore: fix some minor typos in the comments (#7442)
shangchenglumetro [Fri, 4 Jul 2025 09:29:27 +0000 (17:29 +0800)]
chore: fix some minor typos in the comments (#7442)

Signed-off-by: shangchenglumetro <shuang.cui@live.com>
5 months agochangelog: fix typo in `pipe::OpenOptions` for 1.46.0 (#7439)
Alice Ryhl [Wed, 2 Jul 2025 09:27:11 +0000 (11:27 +0200)]
changelog: fix typo in `pipe::OpenOptions` for 1.46.0 (#7439)

5 months agochore: prepare Tokio v1.46.0 (#7437)
Eliza Weisman [Wed, 2 Jul 2025 08:20:42 +0000 (01:20 -0700)]
chore: prepare Tokio v1.46.0 (#7437)

5 months agort(unstable): add spawn `Location` to `TaskMeta` (#7417)
Eliza Weisman [Mon, 30 Jun 2025 18:13:42 +0000 (11:13 -0700)]
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

5 months agonet: derive `Clone` for `net::unix::SocketAddr` (#7422)
xumaple [Mon, 30 Jun 2025 13:31:04 +0000 (09:31 -0400)]
net: derive `Clone` for `net::unix::SocketAddr` (#7422)

5 months agofuzz: cfg fuzz tests under cfg(test) (#7428)
Alice Ryhl [Mon, 30 Jun 2025 08:24:10 +0000 (10:24 +0200)]
fuzz: cfg fuzz tests under cfg(test) (#7428)

6 months agonet: update `AsRawFd` doc link to current Rust stdlib location (#7429)
GarmashAlex [Fri, 27 Jun 2025 14:08:31 +0000 (17:08 +0300)]
net: update `AsRawFd` doc link to current Rust stdlib location (#7429)

6 months agonet: allow `pipe::OpenOptions::read_write` on Android (#7426)
Marshall Pierce [Fri, 27 Jun 2025 07:39:55 +0000 (01:39 -0600)]
net: allow `pipe::OpenOptions::read_write` on Android (#7426)