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

Task: Use async DNS resolution in Socket and web stack code. #13163

Closed
hex11 opened this issue Feb 23, 2019 · 3 comments
Assignees

Comments

@hex11
Copy link

@hex11 hex11 commented Feb 23, 2019

return BeginConnect (Dns.GetHostAddresses (host), port, requestCallback, state);

It causes that BeginConnect() doesn't return immediately but returns until the name resolving completes, then unexpected blocking will happen in some async code calling this method.

@marek-safar

This comment has been minimized.

Copy link
Member

@marek-safar marek-safar commented Feb 25, 2019

@baulig I think this was reported also elsewhere. We should look into using Async or BeginGetHostAddresses versions

@baulig

This comment has been minimized.

Copy link
Member

@baulig baulig commented Feb 25, 2019

It is a common pattern in our entire web stack that we're using sync DNS. I'm not sure whether there was a specific reason for it or whether it's just historic.

@baulig baulig changed the title An overload of Socket.BeginConnect() resolves host synchronously Task: Use async DNS resolution in Socket and web stack code. Feb 25, 2019
@marek-safar marek-safar assigned MaximLipnin and unassigned baulig Mar 6, 2019
@marek-safar

This comment has been minimized.

Copy link
Member

@marek-safar marek-safar commented Mar 29, 2019

@MaximLipnin Dns.GetHostAddresses (host) is sync method but we are calling it from method (async) which should not block. We need to update this to use async version of GetHostAddresses

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.