-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Leak waiters on cancellation #620
Comments
The waiters list probably needs to be an atomic linked list so that an individual waiter can remove itself on-drop. |
In fact, I wonder if the waiters list can be implemented without additional allocations, using the stack- or heap-pinned futures themselves as storage. I realize in the general case that dropping cannot be relied upon for safety, but in the case of a pinned future, I'm not sure it's possible to leak one in safe code without it also remaining a valid memory location for the life of the program: a stack-pinned future cannot be moved into The only possible situation I can think of is where a thread aborts without unwinding its stack or aborting the program as a whole. There's @mehcode, thoughts? We don't have to do this at first or at all but it sounds like something interesting to experiment with. |
In general, can we assume that a pinned value will either have its destructor called or have its memory location remain valid for the life of the program? In fact, the answer appears to be yes, and just above this is an example of exactly what I'm talking about. Awesome. |
I think it's possible to delegate the pool logic to a more focused library e.g |
The semaphore from I'm working on a better core implementation of |
Hi @abonander , i understand your point. |
Fixed by #918 |
Hi, i tried to report on closed issue but no response so i'm open a new one.
Long story short :
Pool hang after some last
accquire
call but get cancelled. Two scenario:-> Due to the pool rely on connection release to trigger wakeup call.
acquire function might be a source of leak. When calling
acquire
on apool
and waiter is pushed to the list, but then theacquire
future is then dropped before the timeout, then the waiter is stuck in the list indefinitely.Originally posted by @singggum3b in #83 (comment)
The text was updated successfully, but these errors were encountered: