-
Notifications
You must be signed in to change notification settings - Fork 422
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
make read_exact_at
cancel-safe
#6101
make read_exact_at
cancel-safe
#6101
Conversation
No tests were run or test report is not availableTest coverage report is not availableThe comment gets automatically updated with the latest test results
53ac78e at 2023-12-12T14:21:15.476Z :recycle: |
Compile error:
I think this is rust-lang/rust#102211 (comment) although I freely admit I don't fully understand that issue. Anyway, following @jcsp 's advice I created a smaller reproducer and found that removing the Follow the process in |
Pass `FileGuard` to the tokio-epoll-uring read() operation. and avoids the nasty scopeguard usage. This makes the `read_exact_at` cancel-safe. Depends on neondatabase/tokio-epoll-uring#27
41a2fc2
to
53ac78e
Compare
53ac78e
into
problame/integrate-tokio-epoll-uring/wip
Before this PR, we didn't move ownership of the
FileGuard
to the read future.This meant the
read_exact_at
future wasn't cancel-safe, because dropping it while theread
future was live could lead to use-after-close
of the file descriptor.We protected against that through a scopeguard.
This PR builds on top of neondatabase/tokio-epoll-uring#27
, passing
FileGuard
ownership to the tokio-epoll-uring read() operation.This makes the
read_exact_at
cancel-safe.