-
Notifications
You must be signed in to change notification settings - Fork 0
7992: io: AioSource now employs IO Safety #85
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,8 +9,7 @@ use mio::Token; | |
| use std::fmt; | ||
| use std::io; | ||
| use std::ops::{Deref, DerefMut}; | ||
| use std::os::unix::io::AsRawFd; | ||
| use std::os::unix::prelude::RawFd; | ||
| use std::os::fd::{AsFd, BorrowedFd}; | ||
| use std::task::{ready, Context, Poll}; | ||
|
|
||
| /// Like [`mio::event::Source`], but for POSIX AIO only. | ||
|
|
@@ -19,7 +18,7 @@ use std::task::{ready, Context, Poll}; | |
| /// [`Aio`] object. | ||
| pub trait AioSource { | ||
| /// Registers this AIO event source with Tokio's reactor. | ||
| fn register(&mut self, kq: RawFd, token: usize); | ||
| fn register(&mut self, kq: BorrowedFd<'_>, token: usize); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Severity: medium 🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. value:useful; category:bug; feedback: The Augment AI reviewer is correct! The signature change is an API breakage and it cannot be made. A new method will need to be added to the trait with a default implementation, so that it does not break the existing implementations . |
||
|
|
||
|
Comment on lines
19
to
22
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a public API break for Changing 🤖 Prompt for AI Agents
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. value:useful; category:bug; feedback: The CodeRabbit AI reviewer is correct! The signature change is an API breakage and it cannot be made. A new method will need to be added to the trait with a default implementation, so that it does not break the implementers . |
||
| /// Deregisters this AIO event source with Tokio's reactor. | ||
| fn deregister(&mut self); | ||
|
|
@@ -37,7 +36,7 @@ impl<T: AioSource> Source for MioSource<T> { | |
| interests: mio::Interest, | ||
| ) -> io::Result<()> { | ||
| assert!(interests.is_aio() || interests.is_lio()); | ||
| self.0.register(registry.as_raw_fd(), usize::from(token)); | ||
| self.0.register(registry.as_fd(), usize::from(token)); | ||
| Ok(()) | ||
| } | ||
|
|
||
|
|
@@ -53,7 +52,7 @@ impl<T: AioSource> Source for MioSource<T> { | |
| interests: mio::Interest, | ||
| ) -> io::Result<()> { | ||
| assert!(interests.is_aio() || interests.is_lio()); | ||
| self.0.register(registry.as_raw_fd(), usize::from(token)); | ||
| self.0.register(registry.as_fd(), usize::from(token)); | ||
| Ok(()) | ||
| } | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These dependency bumps (
mio/nix/mio-aio) could implicitly raise the effective MSRV aboverust-version = "1.71"; consider ensuring CI still exercises/builds on 1.71 so this doesn’t regress older toolchains.Severity: medium
Other Locations
tokio/Cargo.toml:115tokio/Cargo.toml:125tokio/Cargo.toml:160🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
value:good-to-have; category:bug; feedback: The Augment AI reviewer is correct! The Minimum Supported Rust Version (MSRV) could change while updating dependencies. The Tokio project has a CI job that checks the build with 1.71, so such problems would be caught early!