Skip to content
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

async_fd fails to deregister the fd on into_inner #3103

Closed
bdonlan opened this issue Nov 6, 2020 · 0 comments · Fixed by #3104
Closed

async_fd fails to deregister the fd on into_inner #3103

bdonlan opened this issue Nov 6, 2020 · 0 comments · Fixed by #3104
Assignees
Labels
A-tokio Area: The main tokio crate C-bug Category: This is a bug. M-io Module: tokio/io

Comments

@bdonlan
Copy link
Contributor

bdonlan commented Nov 6, 2020

Version
Current master

Platform

Linux [redacted] 5.4.[redacted #1 SMP Thu Oct 8 22:11:29 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Description

The following code fails because AsyncFd does not deregister the inner fd:

#[tokio::test]
async fn reregister() {
    let (a, _b) = socketpair();

    let afd_a = AsyncFd::new(a).unwrap();
    let a = afd_a.into_inner();
    AsyncFd::new(a).unwrap();
}
@bdonlan bdonlan added C-bug Category: This is a bug. A-tokio Area: The main tokio crate M-io Module: tokio/io labels Nov 6, 2020
@bdonlan bdonlan self-assigned this Nov 6, 2020
bdonlan pushed a commit to bdonlan/tokio that referenced this issue Nov 6, 2020
Darksonn pushed a commit that referenced this issue Nov 7, 2020
* async_fd: make into_inner() deregister the fd

Fixes: #3103

* make clippy happy

Co-authored-by: Bryan Donlan <bdonlan@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio Area: The main tokio crate C-bug Category: This is a bug. M-io Module: tokio/io
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant