-
Notifications
You must be signed in to change notification settings - Fork 735
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
Set the close-on-exec flag for the duplicate epoll_fd #1491
Conversation
77e3239
to
d3db03e
Compare
Modified code does not resolve problem completely, because fork can happen between duplicating fd and calling cloexec. I think it is safer to use single syscall: fcntl with the |
d3db03e
to
2b91767
Compare
@MikailBag Thank you for your advice, I have updated the code |
2b91767
to
c01e519
Compare
The close-on-exec flag (FD_CLOEXEC; see fcntl(2)) for the duplicate descriptor created by dup(2) is off. We can use fcntl + F_DUPFD_CLOEXEC to dup the epoll_fd to fix this issue. Fixes: tokio-rs/tokio#3809 Signed-off-by: Tim Zhang <tim@hyper.sh>
c01e519
to
bac5f2e
Compare
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.
LGTM. CI is blocked on rust-lang/rustup#2774.
/retest |
Hi @Thomasdezeeuw , How can I trigger the retest of FreeBSD? |
The problem is that Rustup is currently broken on FreeBSD, see rust-lang/rustup#2774. The good news is that it's (likely) going to be fixed in 1.24.3, which already has a beta release: https://internals.rust-lang.org/t/rustup-1-24-3-seeking-beta-testers-particularly-freebsd/14813. I'll restart the CI once Rustup 1.24.3 stable is released and merge this. |
@Thomasdezeeuw Got it, thanks. |
Thanks @Tim-Zhang, sorry for the delay. |
Set the close-on-exec flag for the duplicate epoll_fd
The close-on-exec flag (FD_CLOEXEC; see fcntl(2)) for the
duplicate descriptor created by dup(2) is off.
We can use fcntl + F_DUPFD_CLOEXEC to dup the epoll_fd to fix this
issue.
Fixes: tokio-rs/tokio#3809
Signed-off-by: Tim Zhang tim@hyper.sh