Commit Graph
3639 Commits
Author SHA1 Message Date
4aa7bbff4c chore: typo fixes (#6213)
Co-authored-by: kwfn <[email protected]>
2023-12-11 19:22:55 +00:00
Bryan BaronandGitHub c06a55088b coop: fix typo in docs for task::unconstrained (#6212) 2023-12-11 17:50:24 +01:00
Alice RyhlandGitHub 92a3455c66 chore: prepare Tokio v1.35.0 (#6197) tokio-1.35.0 2023-12-08 23:35:27 +01:00
Alice RyhlandGitHub 1968565825 chore: use relaxed load for unsync_load (#6203) 2023-12-08 22:28:40 +00:00
Alice RyhlandGitHub c9273f1aee sync: improve safety comments for WakeList (#6200) 2023-12-08 18:57:01 +01:00
Alice RyhlandGitHub e05d0f8c2c changelog: fix missing link for 1.8.2 (#6199) 2023-12-08 17:51:46 +00:00
Alice RyhlandGitHub debcb2254a Revert "net: add SocketAddr::as_abstract_namespace (#6144)" (#6198)
This reverts commit 2400769b54.
2023-12-08 18:44:32 +01:00
tijsvdandGitHub 83b7397e44 io: drop the Sized requirements from AsyncReadExt.read_buf (#6169) 2023-12-08 09:51:08 +01:00
NAHOandGitHub 3991f9f9a4 docs: fix typo in 'tokio/src/sync/broadcast.rs' (#6182) 2023-12-08 09:48:36 +01:00
Alice RyhlandGitHub 48c0e6283f chore: use relaxed load for unsync_load on miri (#6179) 2023-12-08 09:48:15 +01:00
Jack WrennandGitHub d561b5850a taskdump: skip notified tasks during taskdumps (#6194)
Fixes #6051
2023-12-08 09:47:46 +01:00
Weijia JiangandGitHub 3a4aef17b2 runtime: reduce the lock contention in task spawn (#6001) 2023-12-07 10:45:07 +00:00
Andrew WalbranandGitHub a0a58d7edd tokio: update nix dependency to 0.27.1 (#6190) 2023-12-04 16:09:58 +01:00
fzyzcjyandGitHub ed4f766c98 runtime: make Runtime unwind safe (#6189) 2023-12-04 13:07:31 +01:00
zhiqiangxuandGitHub 3ac4cfb68a runtime: move comment to the right place (#6184) 2023-12-03 11:47:40 +01:00
Kamila BorowskaandGitHub 7232424a81 chore: remove uses of unsafe from maybe_done.rs (#6180) 2023-12-01 12:51:42 +01:00
simlayandGitHub 4c33ed33f6 net: add Apple watchOS support (#6176) 2023-11-29 21:16:48 +01:00
Alice RyhlandGitHub 3468b4b72f runtime: document fairness guarantees and current behavior (#6145) 2023-11-29 12:32:58 +01:00
Hans KrutzerandGitHub 2400769b54 net: add SocketAddr::as_abstract_namespace (#6144) 2023-11-25 14:44:34 +00:00
aliuandGitHub a8e8fa6681 time: add DelayQueue::deadline (#6163) 2023-11-23 18:20:26 +01:00
Alice RyhlandGitHub 498288cd31 chore: fix docsrs without net feature (#6166) 2023-11-23 15:20:46 +01:00
Hayden StainsbyandGitHub 7a30504fd4 task: make task span explicit root (#6158)
In Tokio, tasks are optionally instrumented with tracing spans to allow
analysis of the runtime behavior to be performed with tools like
tokio-console.

The span that is created for each task gets currently follows the
default tracing behavior and has a contextual parent attached to it
based on the span that is actual when `tokio::spawn` or similar is
called.

However, in tracing, a span will remain "alive" until all its children
spans are closed. This doesn't match how spawned tasks work. A task may
outlive the context in which is was spawned (and frequently does). This
causes tasks which spawn other - longer living - tasks to appear in
`tokio-console` as having lost their waker when instead they should be
shown as completed (tokio-rs/console#345). It can also cause undesired
behavior for unrelated tracing spans if a subscriber is receiving both
the other spans as well as Tokio's instrumentation.

To fix this mismatch in behavior, the task span has `parent: None` set
on it, making it an explicit root - it has no parent. The same was
already done for all spans representing resources in #6107. This change
is made within the scope of #5792.

Due to a defect in the currently available `tracing-mock` crate, it is
not possible to test this change at a tracing level
(tokio-rs/tracing#2440). Instead, a test for the `console-subscriber`
has been written which shows that this change fixes the defect as
observed in `tokio-console` (tokio-rs/console#490).
2023-11-19 19:21:19 +01:00
Daniel SedlakandGitHub 340d4e5238 runtime: fix comment typos (#6143) 2023-11-19 14:01:29 +01:00
7b555185ff sync: avoid creating resource spans with curernt parent, use a None parent instead (#6107)
A child span stored on sync primitives can keep the parent span open,
unable to be closed by subscribers due to the sync resource referencing it.

Fixes: #6106

Co-authored-by: David Barsky <[email protected]>
2023-11-14 16:24:21 -05:00
Hayden StainsbyandGitHub 135d7ca38e taskdump: fix taskdump cargo config example (#6150)
The documentation for the `Handle::dump()` method includes a description
of the Rust flags needed. However, the sample `.cargo/config.toml` file
is incorrect. It gives the Rust flags as:

```
rustflags = ["--cfg tokio_unstable", "--cfg tokio_taskdump"]
```

However, each command line argument needs to be a separate element in
the array:

```
rustflags = ["--cfg", "tokio_unstable", "--cfg", "tokio_taskdump"]
```

This change corrects that line.
2023-11-14 20:17:05 +01:00
Alice RyhlandGitHub e6720f985d metrics: fix hang in worker_overflow_count test (#6146)
Closes: #6054
2023-11-14 20:13:56 +01:00
Alice RyhlandGitHub d44e995bb0 task: document cancel safety of LocalSet::run_until (#6147)
Closes: #6122
2023-11-14 20:13:43 +01:00
Alice RyhlandGitHub 06660ef00a io: flush in AsyncWriteExt examples (#6149)
Closes: #6068
2023-11-14 20:13:00 +01:00
Alice RyhlandGitHub 2e5773a6fe runtime: handle missing context on wake (#6148) 2023-11-14 14:01:10 +01:00
Carl LercheandGitHub 49eb26f159 chore: prepare Tokio v1.34.0 release (#6138)
This also includes:
  - tokio-macros v2.2.0
tokio-1.34.0 tokio-macros-2.2.0
2023-11-09 11:22:54 -08:00
Carl LercheandGitHub 19d96c0674 io: increase ScheduledIo tick resolution (#6135)
While this is no current evidence that increasing the tick resolution is
necessary, since we have available bits, we might as well use them.
2023-11-08 15:11:18 -08:00
Carl LercheandGitHub 30b2eb17c8 io: fix possible I/O resource hang (#6134)
Use a per-resource tick instead of a single global tick counter. This
prevents the hang issue described by #6133.

Fixes: #6133
2023-11-08 14:05:06 -08:00
aliuandGitHub 8ec3e0d94d metrics: update stats when unparking in multi-thread (#6131) 2023-11-06 17:14:51 +01:00
Yotam OfekandGitHub 161ecec156 stream: fix typo in peekable docs (#6130) 2023-11-05 22:51:09 +01:00
Tymoteusz WiśniewskiandGitHub 61fcc3bc0b time: remove cached elapsed value from driver state (#6097) 2023-11-05 15:00:05 +01:00
Alice RyhlandGitHub 944024e8eb chore: update rust-version to 1.63 in all crates (#6126) 2023-11-04 09:07:22 +01:00
ad hocandGitHub 65f861f478 stream: add StreamExt::peekable (#6095) 2023-11-01 17:32:35 +00:00
Alice RyhlandGitHub 4c8580152d ci: fix docs on latest nightly (#6120) 2023-11-01 16:33:32 +00:00
Hayden StainsbyandGitHub ed32cd194c task: add tests for tracing instrumentation of tasks (#6112)
Tokio is instrumented with traces which can be used to analyze the
behavior of the runtime during execution or post-mortem. The
instrumentation is optional. This is where tokio-console collections
information.

There are currently no tests for the instrumentation.

In order to provide more stability to the instrumentation and prepare
for future changes, tests are added to verify the current behavior. The
tests are written using the `tracing-mock` crate. As this crate is still
unreleased, a separate test create has been added under `tokio/tests`
which is outside the workspace. This allows us to pull in both `tracing`
and `tracing-mock` from the tracing repository on GitHub without
affecting the rest of the tokio repository.

This change adds initial tests for the task instrumentation. Further
tests will be added in subsequent commits.

Once `tracing-mock` is published on crates.io (tokio-rs/tracing#539),
these tests can be moved in with the "normal" tokio integration tests.
The decision to add these tests now is due to the release of
`tracing-mock` taking a while, so it would be better to have tests while
we wait.
2023-10-31 10:02:00 +01:00
Fritz RehdeandGitHub 593dbf55d1 docs: fix typos (#6118) 2023-10-30 15:17:46 +01:00
Satyam1VishwakarmaandGitHub d8a4a5f24b tokio: gate some panicking tests with #[cfg(panic = "unwind")] (#6115) 2023-10-30 11:51:39 +01:00
Alice RyhlandGitHub cc86fef9c0 tokio: gate some panicking tests with #[cfg(panic = "unwind")] (#6110) 2023-10-26 12:28:12 +02:00
Nikolay ArhipovandGitHub f3949cc56d tokio: added vita target support (#6094) 2023-10-25 14:44:41 +02:00
Alice RyhlandGitHub 503fad7908 chore: prepare tokio-util v0.7.10 (#6104) tokio-util-0.7.10 2023-10-25 12:05:47 +02:00
Alice RyhlandGitHub 58acb56a17 ci: update nightly to 2023-10-21 (#6103) 2023-10-24 14:15:25 +00:00
Friedel ZiegelmayerandGitHub d22c549d97 deps: update hashbrown to 0.14 (#6102) 2023-10-24 12:27:39 +02:00
bc48a6fa8d sync: fix broadcast::channel link (#6100)
Co-authored-by: Xianhua Zhou <[email protected]>
2023-10-23 15:40:17 +00:00
Alice RyhlandGitHub 70410836ae task: add tokio_util::sync::TaskTracker (#6033) 2023-10-22 14:35:19 +00:00
Aaron SchweigerandGitHub 881b510a07 sync: add mpsc::Receiver::recv_many (#6010) 2023-10-17 11:01:41 +02:00
Rafael BachmannandGitHub 6871084629 chore: clippy and doc fixes (#6081) 2023-10-16 17:37:51 +02:00