-
Notifications
You must be signed in to change notification settings - Fork 341
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
Fix uds listener hanging on accept #272
Conversation
UDS listener was hanging because the accept method would return `Poll::Pending` without registering the task to be awoken in the case when underlying unix listener returns a WouldBlock that gets converted to None. This is a hacky fix for this case. Should fix async-rs#248
This would be great chance to cover this with a test case to avoid regressions. @mvucenovic, would you be able to find a case that exhibits the (previously broken) behaviour? |
@skade Sure thing, I would like to write a bigger integration test that reproduces this issue, as I've mentioned in the #248. I won't be able to do this today, but will try to finish it before the weekend. I've submitted this PR early, because I consider this change a hacky one, so any suggestions how this should be done better are welcome. |
@mvucenovic Perfect 👍 thanks for letting me know! |
This one should reproduce async-rs#248 bug to prevent further regressions.
Hey @skade, I've added a test that reproduces the listener hanging forever. For me it fails on the master, but passes on this branch. Interesting thing, my first version of test was not running in two different threads, but used join macro, to run server and client concurrently, and that version was green on the current master. It looked something like this:
I'll try to investigate why was that the case, just wanted to mention if somebody has any idea. |
Hi, sorry for the notification, I just wanted to say that I needed to use unix sockets and switching to your fork solved it for me, just like that. You're awesome! :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few nits. :) Thanks!
@skade @yoshuawuyts It seems Clippy checks are failing in this pull request. Should we make Clippy tests not required to pass in CI? |
@stjepang the failure here was an upstream failure iirc that's now been fixed in actions-rs. Re-running the check should solve it. Clippy currently doesn't fail CI. Additionally #270 should be landing soon now which means clippy errors should be resolved. This would allow us to then enable actions-rs/clippy-check#2 (comment) once it's implemented (if we so desire). Anyway, going to restart the CI here which should fix the error! |
Thanks for the review @stjepang, I've updated the PR with your suggestions. |
bors r+ |
UDS listener was hanging because the accept method would return
Poll::Pending
without registering the task to be awoken in the case when underlying unix listener returns aWouldBlock
that gets converted toNone
. This is a hacky fix for this case.Should fix #248