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

submit all op before uring drop #245

Merged
merged 1 commit into from
Feb 27, 2024
Merged

Conversation

hxzhao527
Copy link
Contributor

Fix #229

@hxzhao527 hxzhao527 changed the title Fix #229 submit all op before uring drop Feb 26, 2024
@@ -22,6 +22,7 @@ async fn read_hello(file: &File) {
async fn basic_read() {
let mut tempfile = tempfile();
tempfile.write_all(HELLO).unwrap();
tempfile.as_file_mut().sync_data().unwrap();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just flush make sure that the content can be read.

let f = unsafe { File::from_raw_handle(fd) };

let meta = f.metadata();
std::mem::forget(f);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need forget.
The fd maybe reused by system.

Copy link
Member

@ihciah ihciah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

牛的牛的

@ihciah ihciah merged commit 5784885 into bytedance:master Feb 27, 2024
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

File fd leaked
2 participants