Commit Graph
4563 Commits
Author SHA1 Message Date
linkmauveandGitHub 9c465e2f42 tokio-stream: Simplify TakeWhile with Option::filter() (#8268)
Option::filter() exists since Rust 1.27.0, and is much more readable
than the open coded variant that was there before, using
Option::and_then().

This has been found by clippy.
2026-07-10 21:33:24 +02:00
linkmauveandGitHub d5950a8890 refactor: fix variable name typos (#8267) 2026-07-10 20:53:52 +02:00
linkmauveandGitHub c793a631f7 fs: add safe impl From<OwnedFd> for File (#8266)
This impl was missing to be able to create a tokio::fs::File directly
from an OwnedFd, which can be done in a safe way.  Going through RawFd
required unsafe for the same operation.

And same for Windows using a OwnedHandle instead.
2026-07-10 20:02:38 +02:00
bfd4ddf597 docs: correct spelling typos in comments and doc strings (#8263)
Fix several spelling errors found in comments and documentation:
- mulithreading -> multithreading (tcp_shutdown.rs)
- succeded -> succeeded (signal/windows/sys.rs)
- implementor/implementors -> implementer/implementers (multiple files)

Co-authored-by: maxtaran2010 <[email protected]>
Co-authored-by: Claude Sonnet 4.6 <[email protected]>
Co-authored-by: Alice Ryhl <[email protected]>
2026-07-10 11:03:18 +00:00
Alice RyhlandGitHub cd3bcca32b taskdump: remove crate disambiguators from output (#8264) 2026-07-10 12:09:45 +02:00
wanglei01andGitHub c4c6265a07 net: support Nuttx target os (#8259)
Signed-off-by: wanglei <[email protected]>
2026-07-07 16:01:24 +02:00
Dongpo LiuandGitHub bb2815ae23 task: explain why yield_now defers its waker (#8254)
Since #5223, `yield_now` does not wake the task immediately. Instead,
the waker is handed to the scheduler via `context::defer`, which wakes
it only after running out of ready tasks and polling the IO/timer
driver. Add a comment explaining this, as the reasoning is not obvious
from the bare `context::defer` call.
2026-07-07 15:40:18 +02:00
Leo BlöcherandGitHub e06f16259d sync: reset Chan::rx_waker in chan::Rx's Drop impl (#8095)
I recently fixed a memory leak in an application where tokio's RawTask
storage was being kept alive by a leaked Waker. The task itself was
polling an `mpsc::Receiver` before then being aborted. During cleanup,
all references to the RawTask were dropped, except for the one stored in
`mpsc::chan::Chan::rx_waker`. While the `Receiver` was dropped as part
of the task's future, one of the channel's `Sender`s was leaked outside
the task. This meant the `Chan` was never dropped and its `rx_waker`
contained the leaked Waker.

I fixed the leak by properly cleaning up the `Sender`, but I also think
keeping `rx_waker` around in this case is unnecessary. Once `chan::Rx`
is dropped, it can't be polled anymore, so waking up the registered task
will always be spurious.

The commit includes a regression test to illustrate the problem that is
fixed by removing the waker explicitly.
2026-07-06 14:15:51 +02:00
Minh VuandGitHub 962420a4f3 codec: document UdpFramed decoder errors (#8248) 2026-07-06 13:44:17 +02:00
c637f6e73d fs: implement rename using io-uring (#7800)
---------

Co-authored-by: Mattia Pitossi <[email protected]>
Co-authored-by: vrtgs <[email protected]>
Co-authored-by: Daksh <[email protected]>
2026-07-03 11:18:20 +02:00
MAAZIZ Adel AyoubandGitHub dd683aba3f io: do not treat zero-length reads as EOF in Chain (#8251) 2026-07-03 08:31:33 +02:00
yoda77777andGitHub 9fe3c5619d sync: clarify broadcast lagging semantics and pin them with tests (#8239)
Expand module and API docs around RecvError::Lagged / TryRecvError::Lagged
so capacity rounding, miss counts, and post-lag resume behavior are explicit.
Add integration tests covering slow receivers within capacity, overflow,
per-receiver lag, async recv, and cursor advancement after Lagged.
2026-07-01 16:34:17 +00:00
ebubekir karacaandGitHub 448d1227a1 io: add #[inline] to IO trait impls for in-memory types (#8242)
Add #[inline] hints to poll_read, poll_write, start_seek, poll_complete, poll_fill_buf, and consume implementations for in-memory types (&[u8], Vec<u8>, Cursor<T>).

These are small, leaf implementations that benefit from cross-crate inlining, enabling LLVM to optimize call sites in downstream crates (including bounds-check elision and dead-code path elimination).

Benchmarks show ~16% improvement for slice reads and ~20% for cursor writes.
2026-07-01 18:28:37 +02:00
Minh VuandGitHub 98104c36f1 stream: honor StreamMap::next_many limit (#8215) 2026-07-01 17:55:20 +02:00
WhySoBadandGitHub 61aeb33f51 net: re-enable miri for tests with readable readiness for a socket after a short read (#8238) 2026-07-01 17:52:48 +02:00
MAAZIZ Adel AyoubandGitHub 7b354d22a9 stream: stop polling the underlying stream once map_while yields None (#8233) 2026-06-30 11:18:31 +08:00
Shuang LiandGitHub 4bbd2f4d7c docs: fix missing brace in reactor-refactor.md (#8236) 2026-06-28 23:42:35 +03:00
Tim Vilgot Mikael FredenbergandGitHub 930ca7436b signal: merge windows statics (#8231) 2026-06-28 10:24:29 -07:00
46c830117b fs(tests): do not leak FDs with shutdown background (#8184)
---------

Co-authored-by: Martin Grigorov <[email protected]>
Co-authored-by: Mattia Pitossi <[email protected]>
2026-06-25 17:20:53 +02:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
8f37021c16 ci: bump actions/checkout from 6 to 7 (#8229)
Bumps [actions/checkout](https://github.com/actions/checkout) from 6 to 7.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-25 09:25:48 +03:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
cdaa78fc37 ci: bump actions/cache from 5 to 6 (#8230)
Bumps [actions/cache](https://github.com/actions/cache) from 5 to 6.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-25 08:51:00 +03:00
Matteo MontiandGitHub dba1f20585 sync: implement cancellation token getter for drop guard (#8226) 2026-06-24 15:16:23 +02:00
NanasiandGitHub 95b8895da8 stream: update coop handling for empty and once (#8227) 2026-06-24 12:38:36 +00:00
Giorgio Maria Federico BirnthalerandGitHub 73e8937cc5 util: fix typo in blocking_check.rs comment (#8223)
Replace 'i dont' with 'i don't' in the cfg(not(unix)) stub of
'check_socket_for_blocking'. The line is a casual internal comment
about why WASI is not yet supported there; it just needs the missing
apostrophe.
2026-06-23 20:03:19 +00:00
Ebrahim EldesokyandGitHub 630ec12a4f stream: use cooperative budgeting in tokio_stream::iter (#8218) 2026-06-23 11:42:03 +00:00
060f66c665 docs: clarify cancel safety wording (#8181)
Co-authored-by: Tim Vilgot Mikael Fredenberg <[email protected]>
2026-06-23 09:13:01 +00:00
Prashant Singh ChouhanandGitHub a59f9a0a94 test: add Spawn::poll_until_idle (#8213) 2026-06-23 10:25:14 +02:00
Robert HoltandGitHub aee321206b metrics: add task schedule latency metric (#7986) 2026-06-23 10:23:34 +02:00
Tim Vilgot Mikael FredenbergandGitHub 5f52f113d4 tracing: remove unnecessary span clone (#8126) 2026-06-23 07:51:55 +00:00
Minh VuandGitHub f59aae423e stream: fix overflow in StreamMap::size_hint (#8216) 2026-06-23 09:49:54 +02:00
Minh VuandGitHub dc3a883b99 examples: connect proxy upstream per client (#8217) 2026-06-23 09:49:33 +02:00
66e29121b3 time: fix reversed poll order in timeout doc (#8214)
The timeout doc said the timeout is checked before polling the future,
but the impl polls the future first and only then checks the delay (see
the Future impl for Timeout, which calls me.value.poll before
poll_delay). Reverse the clause to match the implementation. This is
also what makes the rest of the sentence correct: the future can
complete and exceed the timeout without an error precisely because it is
polled before the timeout is checked.

Co-authored-by: Patrick Wehbe <[email protected]>
2026-06-19 22:32:30 +02:00
Tim Vilgot Mikael FredenbergandGitHub daa653d94f tokio: remove needless generic type on LinkedList (#8188) 2026-06-19 23:28:28 +08:00
7892f6020d Implemented io-uring Op<Statx> and applied to read_uring and fs::try_exists (#8080)
* implement Op<Statx> and use it to implement fs::try_exists

* fix statx on unavailable platforms

* complete using only io-uring operations for read_uring

* Implemented io-uring::Op<Statx> and apply it accordingly to read_uring, try_exists

* Added test for io uring statx operations. Checks for cancellations, shutdown, stating multiple files, ELOOP, ENAMETOOLONG, EACCES

* Removed musl as supported platform for io_uring statx operations, as statx is supported on 1.25+ musl, and MSRV that uses 1.25 on all *-linux-musl platforms is 1.93

* Removed pending checks for cancel_op_future since io_uring not available on Linux <5.1, removed stat permission denied test case since it doesn't work on Linux 4.19

* Removed redundant cfg attributes on functions, added STATX_BTIME flag in statx operation, use assert pending in cancel ops

* Uncommented stat_permission_denied test and make sure it doesn't run on platforms that don't support io_uring, removed unnecessary comments, and added TODO on symlink_metadata for when Metadata::from_statx is stabilized

* Statx fd leak drop test added and added STATX_BTIME to file_metadata

* Remove unnecessary utils function, refactored code in statx and statx fd leak test, and removed cfg_io_uring gates (localized the feature gate to the pertinent part of the code that uses it in read_uring)

---------

Co-authored-by: Vrtgs <[email protected]>
2026-06-13 13:30:47 -04:00
da044f27d7 net: disable some Miri tests for TCP socket (#8205)
Co-authored-by: Alice Ryhl <[email protected]>
2026-06-12 10:12:08 +08:00
Mukhammedali BerektassulyandGitHub ecb5125a67 runtime: document interaction with fork() (#8202) 2026-06-10 12:05:27 +00:00
Jean SIMARDandGitHub bde8967853 task: add Stream wrapper for JoinSet (#8189) 2026-06-10 09:04:27 +02:00
Satyam GuptaandGitHub 21e4a2a282 taskdump: support taskdumps on s390x (#8192)
Signed-off-by: satyamg1620 <[email protected]>
2026-06-10 08:55:09 +02:00
Amey PawarandGitHub 2e7930fe58 net: accept ConnectionReset in shutdown_after_tcp_reset test (#8196)
The test asserts shutdown() returns Ok(()) after the peer resets the
connection (linger = 0). This holds on Linux and macOS, but on FreeBSD the
kernel can finish processing the RST before shutdown() runs, so it returns
ConnectionReset and the test fails intermittently -- the oneshot only
synchronizes the application-level drop, not the kernel's RST processing.

Accept Ok(()) or ConnectionReset for the post-reset shutdown, since both
are valid for a connection the peer has already reset.
2026-06-09 15:00:24 +00:00
SabnockandGitHub 67637b348a macros: clarify tokio::main expansion (#8193) 2026-06-09 14:22:46 +02:00
Nicolò PaternosterandGitHub 778e9d97d9 tests: fix typo in io_uring support functions docs (#8186) 2026-06-03 17:37:57 +02:00
elomatrebandGitHub 71362aa609 net: add SocketAddr methods to Unix sockets (#8144) 2026-06-03 09:23:30 +02:00
WhySoBadandGitHub 2de86e557c net: enable more Miri tests for TCP socket (#8180) 2026-06-02 23:50:54 +08:00
RyanStewartandGitHub 326bd2cc44 codec: use libc::memchr for LinesCodec delimiter scan (#8141) 2026-06-02 17:23:18 +02:00
WhySoBadandGitHub 32312ae0d6 net: enable Miri tests for TCP socket (#8156) 2026-05-26 10:40:09 +08:00
Qiqi ZhangandGitHub 37ced33efd time: ensure timers stay in the same runtime after .reset() (#8169) 2026-05-26 10:29:50 +08:00
Tim Vilgot Mikael FredenbergandGitHub 923e72345c time: move lazy-registration state into Sleep (#8132) 2026-05-25 08:11:09 +08:00
Mattia PitossiandGitHub f619fc0587 docs: improve contributing guidelines (#8166) 2026-05-24 09:10:16 +02:00
吴杨帆andGitHub 82fe082ef1 fs: clarify create_dir_all succeeds if path exists (#8149) 2026-05-21 15:43:17 +02:00
Joe GrundandGitHub 1fe1b0e727 task: add JoinMap::try_join_next (#8099) 2026-05-21 15:41:55 +02:00