Commit Graph
118 Commits
Author SHA1 Message Date
RyanStewart 326bd2cc44 codec: use libc::memchr for LinesCodec delimiter scan (#8141) 2026-06-02 17:23:18 +02:00
Mattia Pitossi 159f70bc55 ci: fix ambiguity issue during tokio releases (#7848) 2026-02-09 11:04:59 +01:00
Mattia Pitossi 27d1383581 deps: bump tokio to 1.47.0 (#7862) 2026-01-17 10:06:00 -08:00
Alice Ryhl 9cc02cc88d chore: prepare tokio-util 0.7.18 (#7829) 2026-01-04 13:53:14 +01:00
Qi 12412afea4 deps: bump tokio to 1.44.0 (#7733) 2025-11-13 11:47:34 +02:00
Benjamin RanandBenjamin Ran d84a9e9af3 util: enable loom tests (#7644)
Co-authored-by: Benjamin Ran <[email protected]>
2025-11-06 19:20:08 +08:00
Qi 454fd8c347 chore: prepare tokio-util v0.7.17 (#7719)
Signed-off-by: ADD-SP <[email protected]>
2025-11-02 15:33:25 +01:00
Alice Ryhl 5b4cbbc39e tokio: raise MSRV to 1.71 (#7658) 2025-10-02 11:14:17 +02:00
Alice Ryhl cf6b50a3fd chore: prepare tokio-util v0.7.16 (#7507) 2025-08-03 11:12:41 +02:00
Conrad Ludgate 416e36b0df task: stabilise JoinMap (#7075) 2025-08-03 07:58:28 +00:00
yanyuxing 0e5c5d64f5 future: add adapters of CancellationToken for FutureExt (#7475) 2025-07-29 18:09:13 +08:00
Conrad Ludgate 9e94fa7e15 task: remove raw-entry feature from hashbrown dep (#7252) 2025-07-22 15:52:54 +02:00
Alice Ryhl 4d4d12613b chore: prepare tokio-util v0.7.15 (#7283) 2025-04-23 13:13:48 +02:00
LongYinan f339587b27 deps: update hashbrown to 0.15 (#7219) 2025-03-14 09:47:18 +01:00
Alice Ryhl b663abe091 chore: update tokio-util version number (#7215) 2025-03-13 11:22:34 +01:00
Josh Triplett 638ce93591 io: add read_exact_arc to safely read a new uninitialized Arc (#7165) 2025-02-27 14:07:49 +01:00
M.Amin Rayej 0a15768380 io: clean up buffer casts (#7142) 2025-02-10 19:57:25 +03:30
Taiki Endo 7f09959b0a chore: use [lints] to address unexpected_cfgs lint (#7124) 2025-01-25 17:46:21 +01:00
Alice Ryhl 0b31c2f73d chore: prepare tokio-util v0.7.13 (#7012) 2024-12-04 12:49:55 +01:00
Hayden Stainsby c3a935541d task: add task size to tracing instrumentation (#6881)
In Tokio, the futures for tasks are stored on the stack unless they are
explicitly boxed, either by the user or auto-boxed by Tokio when they
are especially large. Auto-boxing now also occurs in release mode
(since #6826).

Having very large futures can be problematic as it can cause a stack
overflow. In some cases it might be desireable to have smaller futures,
even if they are placed on the heap.

This change adds the size of the future driving an async task or the
function driving a blocking task to the tracing instrumentation. In the
case of a future that is auto-boxed by Tokio, both the final size as well
the original size before boxing is included.

To do this, a new struct `SpawnMeta` gets passed down from where a
future might get boxed to where the instrumentation is added. This
contains the task name (optionally) and the original future or function
size. If the `tokio_unstable` cfg flag and the `tracing` feature aren't both
enabled, then this struct will be zero sized, which is a small improvement
on the previous behavior of unconditionally passing down an `Option<&str>`
for the name.

This will make this information immediately available in Tokio Console,
and will enable new lints which will warn users if they have large futures
(just for async tasks).

We have some tests under the `tracing-instrumentation` crate which test
that the `size.bytes` and `original_size.bytes` fields are set correctly.

The minimal version of `tracing` required for Tokio has been bumped from
0.1.25 to 0.1.29 to get the `Value` impl on `Option<T>`. Given that the current
version is 0.1.40, this seems reasonable, especially given that Tracing's MSRV
is still lower than Tokio's in the latest version.
2024-10-08 10:51:03 +02:00
Timo 35f244ad09 chore: prepare tokio-util v0.7.12 (#6823) 2024-09-05 00:22:11 +02:00
Sarek Høverstad Skotåm 1166ecc2ac config: enable full for tokio-util in the playground (#6818) 2024-09-03 20:34:20 +00:00
Alice Ryhl 15cd5146d4 chore: increase MSRV to 1.70 (#6645) 2024-07-22 18:01:27 +00:00
Alice Ryhl b652a4e64c util: no default features for hashbrown (#6541) 2024-05-05 17:18:49 +02:00
Alice Ryhl cdf9d997dc chore: prepare tokio-util v0.7.11 (#6535) 2024-05-04 22:32:31 +02:00
Jens Reidel d298049299 codec: make tracing feature optional for codecs (#6434)
Signed-off-by: Jens Reidel <[email protected]>
2024-03-30 18:20:05 +01:00
Alice Ryhl 944024e8eb chore: update rust-version to 1.63 in all crates (#6126) 2023-11-04 09:07:22 +01:00
Alice Ryhl 503fad7908 chore: prepare tokio-util v0.7.10 (#6104) 2023-10-25 12:05:47 +02:00
Friedel Ziegelmayer d22c549d97 deps: update hashbrown to 0.14 (#6102) 2023-10-24 12:27:39 +02:00
Chris Constantine 3f6165d82e chore: prepare tokio-util v0.7.9 (#6019) 2023-09-20 19:30:12 +02:00
Consoli 51cffbb74f time: mark Sleep as !Unpin in docs (#5916) 2023-08-06 13:34:08 +02:00
Dhruv Vats 910a1e2fcf io: fix futures_io::AsyncSeek implementaion for Compat (#5783) 2023-06-25 13:04:35 +02:00
tim gretler b8af5aad16 task: add spawn_blocking methods to JoinMap (#5797) 2023-06-24 12:13:56 +02:00
Bugen Zhao e63d0f10bf task: use pin-project for TaskLocalFuture (#5758)
Signed-off-by: Bugen Zhao <[email protected]>
2023-06-10 12:38:52 +02:00
Alice Ryhl 74c6e6c683 chore: prepare tokio-util v0.7.8 (#5651) 2023-04-25 20:21:20 +02:00
Timmy Xiao a7bb054414 tokio: update stream, util, test to 2021 edition (#5571) 2023-03-21 17:36:40 +00:00
Alice Ryhl 0c8e8248f8 tokio: bump MSRV to 1.56 (#5559) 2023-03-21 18:06:47 +01:00
Alice Ryhl e629ad7c9a chore: prepare tokio-util v0.7.7 (#5451) 2023-02-12 12:42:38 +01:00
Alice Ryhl 01bb1ecf4d chore: prepare tokio-util v0.7.6 (#5447) 2023-02-10 10:48:36 +01:00
Alice Ryhl 36d2233579 chore: fix dependency on Tokio (#5445) 2023-02-10 10:13:37 +01:00
Alice Ryhl 74fb9e387a chore: prepare tokio-util v0.7.5 (#5442) 2023-02-09 17:35:53 +01:00
Alice Ryhl dfdb550cd4 chore: prepare tokio-util 0.7.4 (#4987) 2022-09-08 10:34:23 +02:00
Hayden Stainsby ad412a9833 util: add track_caller to public APIs (#4785)
* util: add track_caller to public APIs

Functions that may panic can be annotated with `#[track_caller]` so that
in the event of a panic, the function where the user called the
panicking function is shown instead of the file and line within Tokio
source.

This change adds `#[track_caller]` to all the non-unstable public APIs in
tokio-util where the documentation describes how the function may panic
due to incorrect context or inputs.

In one place, an assert was added where the described behavior appeared
not to be implemented. The documentation for `DelayQueue::reserve`
states that the function will panic if the new capacity exceeds the
maximum number of entries the queue can contain. However, the function
didn't panic until a higher number caused by an allocation failure. This
is inconsistent with `DelayQueue::insert_at` which will panic if the
number of entries were to go over MAX_ENTRIES.

Tests are included to cover each potentially panicking function.

Refs: #4413

* fix tests on FreeBSD 32-bit (I hope)

Some tests were failing on FreeBSD 32-bit because the "times too far in
the future" for DelayQueue were also too far in the future for the OS.

Fixed by copying the MAX_DURATION value from where it's defined and
using it to create a duration that is just 1 more than the maximum. This
will start to break once we get close (within 2 and a bit years) of the
Epochalypse (19 Jan, 2038) - but a lot of other things are going to be
breaking on FreeBSD 32-bit by then anyway.
2022-06-27 12:31:31 +02:00
Alice Ryhl 14c77bc434 chore: prepare tokio-util 0.7.3 (#4744) 2022-06-04 22:04:02 +02:00
Alice Ryhl fa06605e45 Merge 'tokio-util-0.7.x' into master 2022-05-15 10:09:29 +02:00
Alice Ryhl 038de36132 chore: prepare tokio-util 0.7.2 (#4690) 2022-05-14 21:06:13 +02:00
Alice Ryhl 42d5a9fcd4 Merge 'tokio-util-0.6.x' into 'tokio-util-0.7.x' 2022-05-14 21:03:16 +02:00
Alice Ryhl 2659adf5fe chore: prepare tokio-util 0.6.10 (#4691) 2022-05-14 20:16:41 +02:00
Finomnis 0105d9971f sync: rewrite CancellationToken (#4652) 2022-05-14 20:16:36 +02:00
Alice Ryhl ce0e1152ad util: display JoinMap on docs.rs (#4689) 2022-05-14 18:55:26 +02:00