-
Notifications
You must be signed in to change notification settings - Fork 411
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
can there be a race between a read or write operation and a close #782
Comments
I understand the risk of a race if the sqe had not been flushed to the device yet and a close for the same file descriptor made it to the kernel first though another mechanism. I'm curious whether once the |
io_uring resolves files (and takes refs) lazily, so you'd need to wait for completions or order close requests with reads/etc. (e.g. via links). In practice, files are eagerly resolved except for links and draining but that may change. |
Ok. I don't like the answer, (lazy references are taken), but I'm very happy you could answer this so quickly. It means the code that's been in tokio-uring to block closing until all operations on the fd are complete is justified and I won't be lobbying to remove it. Thank you! Edit: Rather than say I didn't like the answer, I should have said I understand but was hoping for a different answer. Your uring device is awesome and we're lucky to have it. |
If a read or write operation is in-flight, has it incremented an entry in the file descriptor table?, so if a close for the same file descriptor were to come to the same submission queue, or a different one, or as a synchronous close(2) call, will the file descriptor be kept open until the in-flight read or write is done?
The text was updated successfully, but these errors were encountered: