Merge 'tokio-1.47.1' into 'master'

This commit is contained in:
Alice Ryhl
2025-08-01 13:21:45 +02:00
7 changed files with 64 additions and 23 deletions
+1 -1
View File
@@ -56,7 +56,7 @@ Make sure you activated the full features of the tokio crate on Cargo.toml:
```toml
[dependencies]
tokio = { version = "1.47.0", features = ["full"] }
tokio = { version = "1.47.1", features = ["full"] }
```
Then, on your main.rs:
+17
View File
@@ -1,3 +1,12 @@
# 1.47.1 (August 1st, 2025)
### Fixed
- process: fix panic from spurious pidfd wakeup ([#7494])
- sync: fix broken link of Python `asyncio.Event` in `SetOnce` docs ([#7485])
[#7485]: https://github.com/tokio-rs/tokio/pull/7485
# 1.47.0 (July 25th, 2025)
This release adds `poll_proceed` and `cooperative` to the `coop` module for
@@ -240,6 +249,14 @@ comment on [#7172].
[#7186]: https://github.com/tokio-rs/tokio/pull/7186
[#7192]: https://github.com/tokio-rs/tokio/pull/7192
# 1.43.2 (August 1st, 2025)
### Fixed
- process: fix panic from spurious pidfd wakeup ([#7494])
[#7494]: https://github.com/tokio-rs/tokio/pull/7494
# 1.43.1 (April 5th, 2025)
This release fixes a soundness issue in the broadcast channel. The channel
+1 -1
View File
@@ -6,7 +6,7 @@ name = "tokio"
# - README.md
# - Update CHANGELOG.md.
# - Create "v1.x.y" git tag.
version = "1.47.0"
version = "1.47.1"
edition = "2021"
rust-version = "1.70"
authors = ["Tokio Contributors <[email protected]>"]
+1 -1
View File
@@ -56,7 +56,7 @@ Make sure you activated the full features of the tokio crate on Cargo.toml:
```toml
[dependencies]
tokio = { version = "1.47.0", features = ["full"] }
tokio = { version = "1.47.1", features = ["full"] }
```
Then, on your main.rs:
+1 -9
View File
@@ -125,7 +125,7 @@ impl<E: Source> PollEvented<E> {
}
/// Returns a reference to the registration.
#[cfg(feature = "net")]
#[cfg(any(feature = "net", all(feature = "process", target_os = "linux")))]
pub(crate) fn registration(&self) -> &Registration {
&self.registration
}
@@ -138,14 +138,6 @@ impl<E: Source> PollEvented<E> {
Ok(inner)
}
#[cfg(all(feature = "process", target_os = "linux"))]
pub(crate) fn poll_read_ready(&self, cx: &mut Context<'_>) -> Poll<io::Result<()>> {
self.registration
.poll_read_ready(cx)
.map_err(io::Error::from)
.map_ok(|_| ())
}
/// Re-register under new runtime with `interest`.
#[cfg(all(feature = "process", target_os = "linux"))]
pub(crate) fn reregister(&mut self, interest: Interest) -> io::Result<()> {
+15 -11
View File
@@ -19,7 +19,7 @@ use std::{
pin::Pin,
process::ExitStatus,
sync::atomic::{AtomicBool, Ordering::Relaxed},
task::{ready, Context, Poll},
task::{Context, Poll},
};
#[derive(Debug)]
@@ -117,17 +117,21 @@ where
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
let this = Pin::into_inner(self);
match ready!(this.pidfd.poll_read_ready(cx)) {
Err(err) if is_rt_shutdown_err(&err) => {
this.pidfd.reregister(Interest::READABLE)?;
ready!(this.pidfd.poll_read_ready(cx))?
match this.pidfd.registration().poll_read_ready(cx) {
Poll::Ready(Ok(evt)) => {
if let Some(exit_code) = this.inner.try_wait()? {
return Poll::Ready(Ok(exit_code));
}
this.pidfd.registration().clear_readiness(evt);
}
res => res?,
}
Poll::Ready(Ok(this
.inner
.try_wait()?
.expect("pidfd is ready to read, the process should have exited")))
Poll::Ready(Err(err)) if is_rt_shutdown_err(&err) => {}
Poll::Ready(Err(err)) => return Poll::Ready(Err(err)),
Poll::Pending => return Poll::Pending,
};
this.pidfd.reregister(Interest::READABLE)?;
cx.waker().wake_by_ref();
Poll::Pending
}
}
+28
View File
@@ -0,0 +1,28 @@
#![cfg(feature = "process")]
#![warn(rust_2018_idioms)]
#![cfg(target_os = "linux")]
#![cfg(not(miri))]
use tokio::process::Command;
use tokio::time::{sleep, Duration};
#[tokio::test]
async fn issue_7144() {
let mut threads = vec![];
for _ in 0..20 {
threads.push(tokio::spawn(test_one()));
}
for thread in threads {
thread.await.unwrap();
}
}
async fn test_one() {
let mut t = Command::new("strace")
.args("-o /dev/null -D sleep 5".split(' '))
.spawn()
.unwrap();
sleep(Duration::from_millis(100)).await;
unsafe { libc::kill(t.id().unwrap() as _, libc::SIGINT) };
t.wait().await.unwrap();
}