Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

signal: don't register write interest on signal pipe #4898

Merged
merged 1 commit into from
Aug 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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