-
Notifications
You must be signed in to change notification settings - Fork 12
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
Panic when releasing write lock #24
Comments
Upon digging into the source, it looks like when any future returned by either |
Ooh, interesting. I suppose it would be too much to ask for the error to be reproducible? |
It's occurs in a massive codebase, randomly too. What I think is going on in my case is a gRPC client is dropping the connection to my tower-grpc server which then cancels the future that was waiting on the lock. If I get some down time, I'll try come up with a small reproducible case. |
I've got a test case! Thanks for reporting this. I'll have a fix soon, probably by Monday at the latest. |
Thanks!! In my fork I tweaked the unlock to loop until it finds a viable receiver. It works, but definitely not the most optimum. |
If a Future gets dropped after being polled() but before gaining ownership of the Mutex or RwLock, a panic would result when the owner tried to transfer ownership to the dropped Future. Fix the drop methods to handle waiting Futures that have already disappeared. Kudos to Kayle Gishen for reporting and diagnosing the bug Fixes #24
If a Future gets dropped after being polled() but before gaining ownership of the Mutex or RwLock, a panic would result when the owner tried to transfer ownership to the dropped Future. Fix the drop methods to handle waiting Futures that have already disappeared. Kudos to Kayle Gishen for reporting and diagnosing the bug Fixes #24
From reading the
oneshot
channel code, this appears to happen when the waiting lock is dropped before it can be notified. (This is just a guess, but the best I could gleam even though I don't believe I have a case where this would happen in my project) The current error message and stack trace makes it impossible to find out which was the offending lock.I also question if this is a good behavior as there is no way (without catching a panic) for the crate user to handle that error.
The text was updated successfully, but these errors were encountered: