Skip to content

Commit 9dd749d

Browse files
committed
Merge 'tokio-1.53.3' into 'master' (#8641)
2 parents d4a0daa + a85c3f5 commit 9dd749d

35 files changed

Lines changed: 1123 additions & 235 deletions

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Make sure you enable the full features of the tokio crate on Cargo.toml:
5656

5757
```toml
5858
[dependencies]
59-
tokio = { version = "1.53.2", features = ["full"] }
59+
tokio = { version = "1.53.3", features = ["full"] }
6060
```
6161
Then, on your main.rs:
6262

‎tokio/CHANGELOG.md‎

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
# 1.53.3 (October 13th, 2026)
2+
3+
### Added
4+
5+
- io: add `AsyncFd::register` and `AsyncFd::register_with_interest` ([#8587])
6+
7+
### Changed
8+
9+
- io: deprecate `AsyncFd::{new, with_interest, try_new, try_with_interest}` ([#8587])
10+
11+
### Fixed
12+
13+
- io: wake and drop `DuplexStream` wakers outside the lock ([#8618])
14+
- macros: avoid `unreachable_code` in `join!` and `try_join!` for `Infallible` ([#8518])
15+
- runtime: fix paused time auto-advancing when I/O wakes a task on `current_thread` ([#8595])
16+
- sync: wake waiters outside the lock when closing a semaphore ([#8529])
17+
- test: fix several flaky tests ([#8196], [#8427], [#8609])
18+
19+
### Fixed (unstable)
20+
21+
- rt: keep `io_uring` op alive when submission fails after push ([#8185])
22+
23+
[#8185]: https://github.com/tokio-rs/tokio/pull/8185
24+
125
# 1.53.2 (October 3rd, 2026)
226

327
### Fixed
@@ -212,6 +236,33 @@ The 1.52.0 release includes all changes up to 1.51.1, but changes in 1.51.2 and
212236
[#8035]: https://github.com/tokio-rs/tokio/pull/8035
213237
[#8040]: https://github.com/tokio-rs/tokio/pull/8040
214238

239+
# 1.51.6 (October 13th, 2026)
240+
241+
### Added
242+
243+
- io: add `AsyncFd::register` and `AsyncFd::register_with_interest` ([#8587])
244+
245+
### Changed
246+
247+
- io: deprecate `AsyncFd::{new, with_interest, try_new, try_with_interest}` ([#8587])
248+
249+
### Fixed
250+
251+
- io: wake and drop `DuplexStream` wakers outside the lock ([#8618])
252+
- macros: avoid `unreachable_code` in `join!` and `try_join!` for `Infallible` ([#8518])
253+
- runtime: fix paused time auto-advancing when I/O wakes a task on `current_thread` ([#8595])
254+
- sync: wake waiters outside the lock when closing a semaphore ([#8529])
255+
- test: fix several flaky tests ([#8196], [#8427], [#8609])
256+
257+
[#8196]: https://github.com/tokio-rs/tokio/pull/8196
258+
[#8427]: https://github.com/tokio-rs/tokio/pull/8427
259+
[#8518]: https://github.com/tokio-rs/tokio/pull/8518
260+
[#8529]: https://github.com/tokio-rs/tokio/pull/8529
261+
[#8587]: https://github.com/tokio-rs/tokio/pull/8587
262+
[#8595]: https://github.com/tokio-rs/tokio/pull/8595
263+
[#8609]: https://github.com/tokio-rs/tokio/pull/8609
264+
[#8618]: https://github.com/tokio-rs/tokio/pull/8618
265+
215266
# 1.51.5 (October 3rd, 2026)
216267

217268
### Fixed

‎tokio/Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ name = "tokio"
66
# - README.md
77
# - Update CHANGELOG.md.
88
# - Create "v1.x.y" git tag.
9-
version = "1.53.2"
9+
version = "1.53.3"
1010
edition = "2021"
1111
rust-version = "1.85"
1212
authors = ["Tokio Contributors <[email protected]>"]

‎tokio/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Make sure you enable the full features of the tokio crate on Cargo.toml:
5656

5757
```toml
5858
[dependencies]
59-
tokio = { version = "1.53.2", features = ["full"] }
59+
tokio = { version = "1.53.3", features = ["full"] }
6060
```
6161
Then, on your main.rs:
6262

‎tokio/src/fs/file.rs‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,14 +1117,21 @@ impl Inner {
11171117
let (res, r_fd, r_buf) =
11181118
// u64::MAX to use and advance the file position
11191119
Op::read_at(fd, buf, max_buf_size, u64::MAX).await;
1120-
match res {
1121-
Err(e) if e.kind() == io::ErrorKind::Interrupted => {
1120+
match (res, r_fd, r_buf) {
1121+
// Retry an interrupted read with the resources the op handed back.
1122+
(Err(e), Some(r_fd), Some(r_buf)) if e.kind() == io::ErrorKind::Interrupted => {
11221123
buf = r_buf;
11231124
fd = r_fd;
11241125
continue;
11251126
}
1126-
Err(e) => break (Operation::Read(Err(e)), r_buf),
1127-
Ok(n) => break (Operation::Read(Ok(n as usize)), r_buf),
1127+
// A cancelled op keeps its buffer in the driver, so the idle slot
1128+
// gets a fresh empty `Buf` instead.
1129+
(Err(e), _, r_buf) => {
1130+
let buf = r_buf.unwrap_or_else(|| Buf::with_capacity(0));
1131+
break (Operation::Read(Err(e)), buf);
1132+
}
1133+
(Ok(n), _, Some(r_buf)) => break (Operation::Read(Ok(n as usize)), r_buf),
1134+
(Ok(_), ..) => unreachable!("a successful read returns its buffer"),
11281135
}
11291136
}
11301137
}

‎tokio/src/fs/read_uring.rs‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,17 +135,20 @@ async fn op_read(
135135
loop {
136136
let (res, r_fd, r_buf) = Op::read_at(fd, buf, read_len as usize, *offset).await;
137137

138-
match res {
139-
Err(e) if e.kind() == ErrorKind::Interrupted => {
138+
match (res, r_fd, r_buf) {
139+
// Retry an interrupted read with the buffer the op handed back. A
140+
// cancelled op returns no buffer, so it falls through as terminal.
141+
(Err(e), Some(r_fd), Some(r_buf)) if e.kind() == ErrorKind::Interrupted => {
140142
buf = r_buf;
141143
fd = r_fd;
142144
}
143-
Err(e) => return Err(e),
144-
Ok(size_read) => {
145+
(Err(e), ..) => return Err(e),
146+
(Ok(size_read), Some(r_fd), Some(r_buf)) => {
145147
*offset += size_read as u64;
146148

147149
return Ok((r_fd, r_buf, size_read == 0));
148150
}
151+
(Ok(_), ..) => unreachable!("a successful read returns its fd and buffer"),
149152
}
150153
}
151154
}

‎tokio/src/fs/write.rs‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,13 @@ async fn write_uring(path: &Path, mut buf: OwnedBuf) -> io::Result<()> {
7777
let mut buf_offset: usize = 0;
7878
let mut file_offset: u64 = 0;
7979
while buf_offset < total {
80-
let (res, _buf, _fd) = Op::write_at(fd, buf, buf_offset, file_offset)?.await;
80+
let (res, r_buf, r_fd) = Op::write_at(fd, buf, buf_offset, file_offset)?.await;
81+
82+
// A cancelled op returns no resources to continue with, so its error is
83+
// terminal; otherwise an interrupted write retries from where it stopped.
84+
let (Some(r_buf), Some(r_fd)) = (r_buf, r_fd) else {
85+
return Err(res.expect_err("a cancelled op completes with an error"));
86+
};
8187

8288
let n = match res {
8389
Ok(0) => return Err(io::ErrorKind::WriteZero.into()),
@@ -86,8 +92,8 @@ async fn write_uring(path: &Path, mut buf: OwnedBuf) -> io::Result<()> {
8692
Err(e) => return Err(e),
8793
};
8894

89-
buf = _buf;
90-
fd = _fd;
95+
buf = r_buf;
96+
fd = r_fd;
9197
buf_offset += n as usize;
9298
file_offset += n as u64;
9399
}

0 commit comments

Comments
 (0)