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

This commit is contained in:
Ivan Petkov 2022-08-10 18:53:01 -07:00 committed by GitHub
parent 9d9488db67
commit d48c4370ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 6 deletions

View File

@ -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,

View File

@ -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 {