We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Assume all slots are in use by submitted operations.
If we now want to perform another tokio-epoll-uring operation, we enqueue in SlotsInnerState::Open::waiters here:
SlotsInnerState::Open::waiters
https://github.com/neondatabase/tokio-epoll-uring/blob/9cf400e9086cea7b2c06960d66276a61fea775a4/tokio-epoll-uring/src/system/slots.rs#L419-L427
If we now drop the returned rx, the tx remains stored in waiters until return_slot gets called and we run
rx
tx
waiters
return_slot
https://github.com/neondatabase/tokio-epoll-uring/blob/9cf400e9086cea7b2c06960d66276a61fea775a4/tokio-epoll-uring/src/system/slots.rs#L219-L236
That happens only if one of the submitted operations completes.
In the meantime, the txes pile up in waiters.
Memory exhaustion and hence OOM kill in pathological cases.
Unlikely, but, could happen if more and more ops are requested and filesystem hangs completely.
The OOM could make it harder to understand the root cause in such cases.
Drop
I found this bug while
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Problem
Assume all slots are in use by submitted operations.
If we now want to perform another tokio-epoll-uring operation, we enqueue in
SlotsInnerState::Open::waiters
here:https://github.com/neondatabase/tokio-epoll-uring/blob/9cf400e9086cea7b2c06960d66276a61fea775a4/tokio-epoll-uring/src/system/slots.rs#L419-L427
If we now drop the returned
rx
, thetx
remains stored inwaiters
untilreturn_slot
gets called and we runhttps://github.com/neondatabase/tokio-epoll-uring/blob/9cf400e9086cea7b2c06960d66276a61fea775a4/tokio-epoll-uring/src/system/slots.rs#L219-L236
That happens only if one of the submitted operations completes.
In the meantime, the
tx
es pile up inwaiters
.Impact
Memory exhaustion and hence OOM kill in pathological cases.
Unlikely, but, could happen if more and more ops are requested and filesystem hangs completely.
The OOM could make it harder to understand the root cause in such cases.
Solution
waiters
array as part ofDrop
impl?waiters
in a semaphore?waiters
with a bounded channel (cap=SLOT_SIZE) that in idle state stores all the slot indices?Context
I found this bug while
The text was updated successfully, but these errors were encountered: