-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
process: Wake up read and write on EPOLLERR
#2218
process: Wake up read and write on EPOLLERR
#2218
Conversation
Signed-off-by: Kevin Leimkuhler <kevin@kleimkuhler.com>
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.
Implementation looks good to me! 👍
However, CI seems to be hanging?
Signed-off-by: Kevin Leimkuhler <kevin@kleimkuhler.com>
It appears kqueue possibly has different behavior on FreeBSD than MacOS.. unfortunately don't see much online about possible differences. Both MacOS and FreeBSD have the same |
2b3c123
to
4d816a5
Compare
@kleimkuhler I don't know if this is of any help: https://stackoverflow.com/questions/49481723/difference-in-kqueue-handling-of-fifos-between-mac-os-and-freebsd Also, I tried to try this out but I'm using a tonic server and when I switch to your pr branch I get |
Signed-off-by: Kevin Leimkuhler <kevin@kleimkuhler.com>
@daniel-emotech I looked into the SO issue as well as a few others and unfortunately have not found anything helpful. If either of the expected flags were set, there would still be an If someone comes along with this issue on FreeBSD, then there will at least be the chance to ask them for |
Awesome, do you think this will make it into the next release? Just asking cause I'm currently using a timeout to detect when this occurs and then just never joining threads it happens to which is less than ideal 😬. The only saving grace is it only happens with a certain type of media file no clients have sent to the API just my own internal testing 👀 |
process: Wake up read and write on `EPOLLERR` (tokio-rs#2218)
Motivation
#2174
On epoll platforms, the read end of a pipe closing is signaled to the write end
through the
EPOLLERR
event [1]. If readiness is not registered for thisevent, it will silently pass through
epoll_wait
calls.Additionally, this specific case that
EPOLLERR
is triggered leaves the writeend of the pipe (parent process) waiting for a wakeup that never occurs.
Solution
Similar to the
HUP
event on Unix platforms, errors are now always maskedthrough registrations so that both read and write ends of a connection are made
aware of errors.
In cases where pipes are used and the read end closes, write ends that are
waiting for a wakeup are properly notified and try to write again. This allows
a client to observe
BrokenPipe
and go through the proper cleanup and/orrestablishment of connection.
Closes #2174
Signed-off-by: Kevin Leimkuhler kevin@kleimkuhler.com