Commit Graph
3948 Commits
Author SHA1 Message Date
tiifandGitHub 4047d7962a miri: add annotations for tests with miri ignore (#6981) 2024-11-20 11:44:28 +01:00
Maarten de VriesandGitHub cbdceb91ac io: add AsyncFd::try_io() and try_io_mut() (#6967) 2024-11-19 17:55:54 +01:00
Hamir MahalandGitHub d4178cf349 tokio: avoid positional fmt params when possible (#6978) 2024-11-18 13:50:58 +01:00
tiifandGitHub 2f899144ed io: avoid ptr->ref->ptr roundtrip in RegistrationSet (#6929) 2024-11-16 11:16:09 +01:00
tiifandGitHub 6255598baa docs: update miri test command in CONTRIBUTING.md (#6976) 2024-11-15 17:29:11 +01:00
Jonas FassbenderandGitHub 772e0ca8a6 docs: fix documentation build on Windows (#6945) 2024-11-14 01:28:55 +09:00
Michael_LiuandGitHub 3b677d1fde net: fix docs discription in unix module (#6791) 2024-11-11 14:14:46 +00:00
Alice RyhlandGitHub bb7ca7507b chore: prepare Tokio v1.41.1 (#6959)
Signed-off-by: Alice Ryhl <[email protected]>
tokio-1.41.1
2024-11-07 11:56:09 +01:00
Russell CohenandGitHub 4a34b77af5 metrics: fix bug with wrong number of buckets for the histogram (#6957) 2024-11-07 08:45:36 +01:00
DaniPopesandGitHub 8897885425 docs: fix mismatched backticks in CONTRIBUTING.md (#6951)
It's rendered correctly at least on GitHub, but syntax highlighting fails after that point.
2024-11-04 10:29:57 +00:00
Taiki EndoandGitHub 0dbdd196b6 ci: update cargo-check-external-types to 0.1.13 (#6949) 2024-11-02 16:50:00 +09:00
Joseph PerezandGitHub 94e55c092b net: fix typo in TcpStream internal comment (#6944) 2024-10-29 09:31:39 +00:00
Jonas FassbenderandGitHub 4468f27c31 metrics: fixed flaky worker_steal_count test (#6932) 2024-10-28 09:26:45 +01:00
Jonas FassbenderandGitHub 070a825999 metrics: removed race condition from global_queue_depth_multi_thread test (#6936) 2024-10-27 19:36:18 +01:00
Jonas FassbenderandGitHub 946401c345 net: display net requirement for net::UdpSocket in docs (#6938) 2024-10-26 12:37:39 +02:00
Taiki EndoandGitHub 0c01fd23b4 ci: use patched version of cargo-check-external-types to fix CI failure (#6937) 2024-10-26 10:27:59 +02:00
Alice RyhlandGitHub ebe241647e ci: use cargo deny (#6931) 2024-10-23 18:48:07 +02:00
Motoyuki KimuraandGitHub 01e04daaa1 chore: prepare Tokio v1.41.0 (#6917) tokio-1.41.0 2024-10-22 11:22:33 +02:00
Josh McKinneyandGitHub 92ccadeb3c runtime: fix stability feature flags for docs (#6909) 2024-10-22 11:19:57 +02:00
Russell CohenandGitHub fbfeb9a68a metrics: rename *_poll_count_* to *_poll_time_* (#6924)
A consistent bit of feedback I've heard is that the `poll_count_histogram` name is a little confusing since the value customers actually get out of it is `poll_times`.

This renames all public APIs from `poll_count` to `poll_time`. The existing APIs were deprecated with one exception: the newly added `poll_count_histogram_configuration` which hasn't been released yet was simply renamed.
2024-10-22 09:21:07 +02:00
Russell CohenandGitHub da745ff335 metrics: add H2 Histogram option to improve histogram granularity (#6897) 2024-10-21 14:05:45 +02:00
Jonas FassbenderandGitHub ce1c74f1cc metrics: fix deadlock in injection_queue_depth_multi_thread test (#6916) 2024-10-21 10:04:39 +02:00
Motoyuki KimuraandGitHub 28c9a14a2e metrics: rename injection_queue_depth to global_queue_depth (#6918) 2024-10-18 19:34:06 +00:00
Alice RyhlandGitHub 32e0b4325f ci: freeze FreeBSD and wasm-unknown-unknown on rustc 1.81 (#6911)
Signed-off-by: Alice Ryhl <[email protected]>
2024-10-18 13:14:17 +02:00
1656d8e231 sync: add mpsc::Receiver::blocking_recv_many (#6867)
Fixes: #6865
Co-authored-by: Rafael Bachmann <[email protected]>
2024-10-17 11:02:12 +02:00
Russell CohenandGitHub c9e998e4b3 ci: print the correct sort order of the dictionary on failure (#6905) 2024-10-17 10:45:38 +02:00
Noah KennedyandGitHub 512e9decfb rt: add LocalRuntime (#6808)
This change adds LocalRuntime, a new unstable runtime type which cannot be transferred across thread boundaries and supports spawn_local when called from the thread which owns the runtime.

The initial set of docs for this are iffy. Documentation is absent right now at the module level, with the docs for the LocalRuntime struct itself being somewhat duplicative of those for the `Runtime` type. This can be addressed later as stabilization nears.

This API has a few interesting implementation details:
- because it was considered beneficial to reuse the same Handle as the normal runtime, it is possible to call spawn_local from a runtime context while on a different thread from the one which drives the runtime and owns it. This forces us to check the thread ID before attempting a local spawn.
- An empty LocalOptions struct is passed into the build_local method in order to build the runtime. This will eventually have stuff in it like hooks.

Relates to #6739.
2024-10-12 10:39:23 -05:00
Motoyuki KimuraandGitHub 5ada5114df task: stabilize task::Id related apis (#6891) 2024-10-11 10:38:07 +00:00
tiifandGitHub 161b8c80d5 ci: test more things with miri (#6885) 2024-10-11 09:44:50 +02:00
Sören MeierandGitHub 9cc4a81678 sync: add watch::Sender::sender_count (#6836)
This makes it possible to check if other senders exist. For example
If you are using a Sender as a subscriber to get a Receiver and might want
to know if the real sender is still running.
2024-10-11 04:31:11 +02:00
NameandGitHub 679d7657dc io: document cancel safety of AsyncFd methods (#6890) 2024-10-09 01:08:41 +09:00
Hayden StainsbyandGitHub 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
NurandGitHub 29cd6ec1ec time: import Future trait from std instead of futures_core (#6884) 2024-10-07 14:13:09 +02:00
b68f5c7f38 task: stabilize task ids (#6793)
Co-authored-by: Alice Ryhl <[email protected]>
2024-10-06 08:50:21 +00:00
Motoyuki KimuraandGitHub 6c5dbfa08c readme: update miri test command (#6883) 2024-10-05 17:22:20 +02:00
oxalicaandGitHub 2c14f88c90 macros: suppress clippy::needless_return in #[tokio::main] (#6874) 2024-09-28 12:33:51 +02:00
shray sharmaandGitHub e2e1e8e71d sync: fix Stream link in broadcast docs (#6873) 2024-09-27 13:49:06 +02:00
TimoandGitHub 21df16d759 sync: apply cooperative scheduling to sync::broadcast::Receiver (#6870) 2024-09-26 16:52:46 +02:00
TimoandGitHub c8af499990 sync: apply cooperative scheduling to sync::watch (#6846) 2024-09-26 12:36:22 +00:00
Nick MathewsonandGitHub 623928e371 net: add conversions for unix SocketAddr (#6868) 2024-09-25 13:56:52 +00:00
Motoyuki KimuraandGitHub 09bc9a05e4 chore: use boxed slice if possible (#6858) 2024-09-25 19:45:28 +09:00
Alice RyhlandGitHub 82628b8a78 metrics: don't hang in injection_queue_depth_multi_thread test (#6862) 2024-09-24 08:34:17 +02:00
Alice RyhlandGitHub 21cf5a5469 runtime: avoid pointer casts in IO driver on miri (#6859)
Signed-off-by: Alice Ryhl <[email protected]>
2024-09-23 20:32:37 +02:00
vxzyfx's githubandGitHub 8ef5163df8 stream: fix link on Peekable (#6861) 2024-09-23 14:56:42 +00:00
Owen LeungandGitHub 542197cdb9 metrics: stabilize injection_queue_depth metric (#6854) 2024-09-22 18:38:37 +02:00
vxzyfx's githubandGitHub a302367b8f net: change quotes in docs (#6852) 2024-09-21 13:53:34 +02:00
Maximilian HilsandGitHub b5de84d19b runtime: box futures larger than 16k on release mode (#6826) 2024-09-16 22:15:44 +02:00
Jonas FassbenderandGitHub 02aaea28b9 sync: document runtime compatibility (#6833) 2024-09-16 21:58:24 +02:00
RustinandGitHub 83e922f051 macros: render more comprehensible documentation for try_join! (#6841)
Signed-off-by: Rustin170506 <[email protected]>
2024-09-14 11:34:45 +02:00
Benjamin RichnerandGitHub a2496548d1 net: fix examples for TcpSocket::{set_nodelay,nodelay} (#6840) 2024-09-12 15:07:16 +02:00