-
Notifications
You must be signed in to change notification settings - Fork 11
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
Handle UNPARKING state in Receiver::drop() #60
Conversation
Interesting. Good find! I wonder if
|
I wonder if we can write a |
I managed to write a test that proves the bug you encounter exists on You also have some CI failures to look into. Looks like you have to make sure |
Thank you so much for the contribution! I went ahead and merged this together with my test. I'll make some minor adjustments, according to the feedback I left above. Hoping to have this out as a release fairly soon. |
Released as |
I am observing that the
unreachable!()
branch is occasionally hit inReceiver::drop()
under multithreaded load in async scenarios. This appears to be because theUNPARKING
state is not handled in thematch
. Now it is.I am not 100% confident in the correctness of the logic I added here - while the code in this crate is very well commented and proved easy to work with, I do not quite have the right state transitions mapped out in my head. Therefore, I just tried to follow what a similar block in a recv implementation above does. It eliminated this crash for me, at least, but perhaps I missed something. I am not even 100% convinced whether/when the
UNPARKING
state can be reached here (I cannot rule out a programming error in my code usingoneshot
wrongly).