Skip to content

Commit

Permalink
signal: don't register write interest on signal pipe (#4898)
Browse files Browse the repository at this point in the history
  • Loading branch information
ipetkov authored Aug 11, 2022
1 parent 9d9488d commit d48c437
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 2 additions & 5 deletions tokio/src/signal/unix/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion tokio/tests/rt_metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit d48c437

Please sign in to comment.