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

deadlock footgun when io_uring op completes but the op future doesn't get polled #60

Open
problame opened this issue Oct 28, 2024 · 0 comments

Comments

@problame
Copy link
Collaborator

problame commented Oct 28, 2024

Test test_slot_exhaustion_behavior_when_op_completes_but_future_does_not_get_polled added here:

https://github.com/neondatabase/tokio-epoll-uring/pull/61/files#diff-42ff2d8c02106563d45de5a3c6fba2769e81d4438c3afc7acc7becdc55b3ea47R399

... documents a footgun when trying to submit many IOs from a single tokio task & failing to recognize that the futures are interdependent due to the interdependence on the fixed resource of slots.

Not a problem in practice for Pageserver because we don't have that pattern there.

But, could happen that we want to do something like that in the future.

Solution

No idea whether we can leverage the Rust typesystem to prevent this.

problame added a commit that referenced this issue Oct 29, 2024
In #57 there
were doubts about the behavior when we're waiting for slots, and when we
return slots.

This PR adds test cases that demonstrate the current behavior.

The behavior demoed in
`test_slot_exhaustion_behavior_when_op_completes_but_future_does_not_get_polled`
might be surprising, but, is not a huge problem in Pageserver right now
because generally we don't have that pattern in the codebase.
Created an issue nonetheless, this can be improved:
#60

closes #57
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

No branches or pull requests

1 participant