Commit Graph
3535 Commits
Author SHA1 Message Date
Weijia Jiang a6be73eecb codec: document the line ending used by LinesCodec (#5982) 2023-09-08 15:59:48 +02:00
M.Amin Rayej 9fafe783d3 io: support vectored writes for DuplexStream (#5985) 2023-09-08 12:57:18 +02:00
Joan Antoni RE fb3ae0a254 docs: fix worker_overflow_count (#5988) 2023-09-07 14:16:52 -05:00
Hayden Stainsby aad1892ab5 task: fix spawn_local source location (#5984)
The location of a spawned task, as shown in tokio console, is taken from
the location set on the tracing span that instruments the task. For this
location to work, there must be unbroken chain of functions instrumented
with `#[track_caller]`.

For `task::spawn_local`, there was a break in this chain and so the
span contained the location of an internal function in tokio.

This change adds the missing `#[track_caller]` attribute. It has been
tested locally as automated tests would really need `tracing-mock` to be
published so we can use it in the tokio tests.
2023-09-06 10:55:47 +02:00
Hayden Stainsby 8ea303e027 chore: list 1.32.x as LTS release (#5980) 2023-09-05 10:02:50 +02:00
M.Amin Rayej 84ed35ef70 process: document that Child::wait is cancel safe (#5977) 2023-09-04 10:24:55 +02:00
Jack Wrenn 95fb599664 tokio: render taskdump documentation on docs.rs (#5972)
Modifies `package.metadata.docs.r` so that `--cfg tokio_taskdump`
is used by docs.rs when building documentation.
2023-09-02 11:43:31 +02:00
ComplexSpaces 8b312ee571 macros: use ::core qualified imports instead of ::std inside tokio::test macro (#5973) 2023-09-02 03:44:08 +09:00
Colin Walters fd7d0ad5e5 io: add SyncIOBridge::into_inner (#5971) 2023-09-01 13:01:22 +00:00
M.Amin Rayej 37bb47c4a2 fs: add vectored writes to tokio::fs::File (#5958) 2023-08-29 14:18:16 +02:00
Rain cb1e10b745 sync: improve docs for watch channels (#5954)
## Motivation

I found the watch docs as written to be somewhat confusing.

* It wasn't clear to me whether values are marked seen or not at
  creation/subscribe time.
* The example also confused me a bit, suggesting a while loop when a
  do-while loop is generally more correct.
* I noticed a potential race with `borrow` that is no longer an issue
  with `borrow_and_update`.

## Solution

Update the documentation for the watch module to try and make all this
clearer.
2023-08-28 16:13:07 -07:00
Alice Ryhl fb3028f3a2 test: fix testing category slug (#5953) 2023-08-26 17:09:49 +02:00
Alice Ryhl b45f5831cf tokio: remove stats feature (#5952) 2023-08-26 17:09:33 +02:00
Rain 0fe24fcffa sync: improve cancel-safety documentation for mpsc::Sender::send (#5947)
This specific issue (data loss because a send got cancelled) has bitten
our team a couple of times over the last few months. We've switched to
recommending this kind of reserve pattern instead.
2023-08-25 22:03:23 +00:00
Eliza Weisman d1dae25cd2 ci: drop MIPS targets from cross-check (#5951)
Currently, Tokio runs cross-compilation checks for the
`mips-unknown-linux-gnu` and `mipsel-unknown-linux-musl` target triples.
However, Rust has recently demoted these targets from Tier 2 support to
Tier 3 (see rust-lang/compiler-team#648). Therefore, MIPS toolchains may
not always be available, even in stable releases. This is currently
[breaking our CI builds][1], as Rust 1.72.0 does not contain a standard
library for `mips-unknown-linux-gnu`.

This branch removes these builds from the cross-compilation check's
build matrix. Tokio may still build successfully for MIPS targets, but
we can't easily guarantee support when the stable Rust release train may
or may not be able to build for MIPS targets.

[1]: https://github.com/tokio-rs/tokio/actions/runs/5970263562/job/16197657405?pr=5947#step:3:80
2023-08-25 14:40:32 -07:00
nicflower 59c9364689 io: pass through IO traits for StreamReader and SinkWriter (#5941) 2023-08-23 17:46:39 +00:00
Alice Ryhl 3b79be624d chore: prepare tokio-test v0.4.3 (#5943) tokio-test-0.4.3 2023-08-23 12:38:11 +02:00
Jiahao XU 8955ed5f85 sync: add const fn OnceCell::from_value (#5903)
Signed-off-by: Jiahao XU <[email protected]>
2023-08-22 13:32:56 +02:00
Matilda Smeds bc26934e3b sync: add Semaphore example that limits open files (#5939) 2023-08-20 12:14:41 +02:00
Hamza Jadid 3d64a06600 docs: added trailing backticks (#5938) 2023-08-17 17:22:34 -05:00
Carl Lerche a7d52c2fed chore: prepare Tokio v1.32.0 release (#5937) tokio-1.32.0 2023-08-16 14:11:30 -07:00
Marek Kuskowski f5f2b58b8d rt: improve docs for Builder::max_blocking_threads (#5793)
Closes #5777
2023-08-16 12:12:53 -07:00
mahkoh 718dcc8dff docs: BytesMut::with_capacity does not guarantee exact capacity (#5870) 2023-08-16 10:29:29 -07:00
Folkert de Vries 10e141d211 io: add Ready::ERROR and report error readiness (#5781)
Add `Ready::ERROR` enabling callers to specify interest in error readiness. Some platforms use error
readiness notifications to notify of other events. For example, Linux uses error to notify receipt of
messages on a UDP socket's error queue.

Using error readiness is platform specific.

Closes #5716
2023-08-16 10:28:19 -07:00
Carl Lerche 6e42c26c80 rt(alt): tweak some constants to improve scalability (#5935)
This patch aims to reduce the number of threads that get no-op wakeups.
2023-08-16 08:20:48 -07:00
Folkert de Vries 82bef00db4 io: minor tweaks to AsyncFd (#5932) 2023-08-14 19:13:14 +02:00
Alice Ryhl 40633fc678 readme: list previous LTS releases (#5931) 2023-08-14 19:10:24 +02:00
Aspen Smith 3dd5f7ae2e sync: move broadcast waiters into separate list before waking (#5925)
Within `notify_rx`, looping while re-locking and re-reading from
`Shared.tail` as long as there are still available wakers causes a
quadratic slowdown as receivers which are looping receiving from the
channel are added. Instead of continually re-reading from the original
list, this commit modifies `notify_rx` to move the waiters into a
separate list immediately similar to how `Notify::notify_waiters` works,
using a new `WaitersList` struct modified after NotifyWaitersList.

Fixes #5923
2023-08-14 19:09:56 +02:00
Félix Saparelli 2c92cad9db process: stabilize Command::raw_arg (#5930) 2023-08-13 10:03:11 +02:00
joe thomas 197757d440 streams: create StreamMock for testing Streams (#5915)
Introduce a new mock type to tests streams and eventually
sinks. Only includes next() and wait() for now. Fixes #4106
2023-08-12 19:18:23 +00:00
Carl Lerche 8b8005ebdd chore: prepare Tokio v1.31.0 release (#5928) tokio-1.31.0 2023-08-12 09:37:49 -07:00
Carl Lerche 6cb106c353 rt: unstable EWMA poll time metric (#5927)
Because the runtime uses this value as a tuning heuristic, it can be
useful to get its value. This patch exposes the value as an unstable
metric.
2023-08-10 19:43:44 +00:00
Carl Lerche dd23f08c3a rt(alt): fix memory leak and increase max preemption when running Loom CI tests (#5911)
The memory leak was caused by a bug during shutdown where some state was leaked.
2023-08-10 09:18:10 -07:00
Jakub Kubík 5d29bdfb0c io: delegate WriteHalf::poll_write_vectored (#5914) 2023-08-10 10:11:00 +02:00
Brian Cardarella 4c220af777 chore: prepare Tokio v1.30.0 release (#5917) tokio-1.30.0 2023-08-09 15:16:11 +00:00
Jiahao XU 0a631f88e8 process: add {ChildStd*}::into_owned_{fd, handle} (#5899) 2023-08-09 16:04:53 +02:00
Carl Lerche ee44dc98d8 ci: fix MIRI tests (#5919)
A change to parking lot or miri resulted in CI breaking.
2023-08-08 12:34:19 -07:00
Consoli 51cffbb74f time: mark Sleep as !Unpin in docs (#5916) 2023-08-06 13:34:08 +02:00
Carl Lerche 8832e936b1 rt(alt): fix a number of concurrency bugs (#5907)
Expands loom coverage and fixes a number of bugs.

Closes #5888
2023-08-04 11:59:38 -07:00
Victor Timofei dbda2045f1 time: implement extra reset variants for Interval (#5878) 2023-08-04 19:12:51 +02:00
Carl Lerche 7c54fdce3e rt: pop at least one task from inject queue (#5908)
When attempting to pull a batch of tasks from the injection queue,
ensure we set the cap to at least one.
2023-08-04 08:24:01 -07:00
wathen 38d1bcd9df sync: avoid false sharing in mpsc channel (#5829) 2023-08-03 15:54:19 +02:00
Alice Ryhl 52e6510215 runtime: fix flaky test wake_while_rt_is_dropping (#5905) 2023-08-02 22:30:34 +02:00
Taiki Endo e5e88551d2 Update CI config (#5893) 2023-08-02 01:04:11 +09:00
Jiahao XU efe3ab679a sync: make const_new methods always available (#5885)
Since MSRV is bumped to 1.63, `Mutex::new` is now usable in const context.

Also use `assert!` in const function to ensure correctness instead of
silently truncating the value and remove cfg `tokio_no_const_mutex_new`.

Signed-off-by: Jiahao XU <[email protected]>
2023-07-28 13:46:21 +02:00
Jiahao XU fb08591b43 tokio: removed unused tokio_* cfgs (#5890)
Signed-off-by: Jiahao XU <[email protected]>
2023-07-28 12:54:55 +02:00
kiron1 6aca07bee7 example: use copy_bidirectional in proxy.rs (#5856) 2023-07-28 12:06:44 +02:00
Jiahao XU 5128601898 ci: fix clippy warnings (#5891)
Signed-off-by: Jiahao XU <[email protected]>
2023-07-28 12:05:32 +02:00
Jiahao XU c445e467ce tokio: bump MSRV to 1.63 (#5887) 2023-07-27 10:57:19 +02:00
Carl Lerche a58beb3aca rt(alt): track which workers are idle. (#5886)
The scheduler uses this map to avoid trying to steal from idle workers.
2023-07-21 14:00:33 -07:00