From d48c4370ceead56b1846bf638474cd9536d0fe62 Mon Sep 17 00:00:00 2001 From: Ivan Petkov Date: Wed, 10 Aug 2022 18:53:01 -0700 Subject: [PATCH] signal: don't register write interest on signal pipe (#4898) --- tokio/src/signal/unix/driver.rs | 7 ++----- tokio/tests/rt_metrics.rs | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/tokio/src/signal/unix/driver.rs b/tokio/src/signal/unix/driver.rs index e14a6d77747..ba2edc35167 100644 --- a/tokio/src/signal/unix/driver.rs +++ b/tokio/src/signal/unix/driver.rs @@ -74,11 +74,8 @@ impl Driver { let original = ManuallyDrop::new(unsafe { std::os::unix::net::UnixStream::from_raw_fd(receiver_fd) }); let receiver = UnixStream::from_std(original.try_clone()?); - let receiver = PollEvented::new_with_interest_and_handle( - receiver, - Interest::READABLE | Interest::WRITABLE, - park.handle(), - )?; + let receiver = + PollEvented::new_with_interest_and_handle(receiver, Interest::READABLE, park.handle())?; Ok(Self { park, diff --git a/tokio/tests/rt_metrics.rs b/tokio/tests/rt_metrics.rs index 914723445cd..e4cd7845ec9 100644 --- a/tokio/tests/rt_metrics.rs +++ b/tokio/tests/rt_metrics.rs @@ -400,7 +400,7 @@ fn io_driver_ready_count() { let stream = tokio::net::TcpStream::connect("google.com:80"); let _stream = rt.block_on(async move { stream.await.unwrap() }); - assert_eq!(metrics.io_driver_ready_count(), 2); + assert_eq!(metrics.io_driver_ready_count(), 1); } fn basic() -> Runtime {