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

fix(net): cancel async resolver on drop #162

Merged
merged 2 commits into from
Nov 30, 2023

Conversation

Berrysoft
Copy link
Member

The AsyncResolver need to cancel the async task on drop, in case the user drops it before the task completes.

@Berrysoft Berrysoft added bug Something isn't working package: net Related to compio-net labels Nov 29, 2023
@Berrysoft Berrysoft self-assigned this Nov 29, 2023
@George-Miao
Copy link
Member

George-Miao commented Nov 29, 2023

Is this just a leak or potential unsafety? Can you add some document on cancel safety for AsyncResolver and ToSocketAddrsAsync?

@Berrysoft
Copy link
Member Author

After this fix, it's a potential leak with glibc, and always safe in other impls. Documents have been added.

Copy link
Member

@George-Miao George-Miao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Berrysoft Berrysoft merged commit f487754 into compio-rs:master Nov 30, 2023
11 checks passed
@Berrysoft Berrysoft deleted the fix/resolver-drop branch November 30, 2023 06:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working package: net Related to compio-net
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants