Skip to content

Simplify and fix c-ares TCP path on Windows#19397

Merged
apolcyn merged 2 commits intogrpc:masterfrom
apolcyn:fix_ares_windows_tcp
Jun 26, 2019
Merged

Simplify and fix c-ares TCP path on Windows#19397
apolcyn merged 2 commits intogrpc:masterfrom
apolcyn:fix_ares_windows_tcp

Conversation

@apolcyn
Copy link
Copy Markdown
Contributor

@apolcyn apolcyn commented Jun 19, 2019

Fixes the bug brought up in this comment: #18411 (comment)

Overall, this change makes the following main changes:

  1. Use ConnectEx to connect TCP sockets. Using WSAConnect for TCP sockets is broken - TCP queries work in manual tests with the local DNS server in manual test script, only because, as it appears, the connect is fast enough and the verbose logs slows things down enough that we get lucky and avoid hitting WSAENOTCONN errors on reads and writes of TCP sockets.
  2. Split up the TCP and UDP "connect" and "send" logic. The current code tries to share a lot of things between the TCP and UDP paths by doing something that will work for both, but this ends up overly complicating things.
  3. Use the new WSAErrorContext object for propagating socket errors to c-ares

So far I've been testing this with a one-off AAAA record in the GCP testing project called large-aaaa-record.apolcyn.exp-test-zone, which has ~40 IPv6 addresses and is ~1K in size, so triggers TCP fallback. I'm trying to figure out if there's a way that I can publish an externally visible DNS record under the unittest.grpc.io domain. But that aside, this is ready for review.


Original repro test scripts being added in #19459

@apolcyn apolcyn added lang/core release notes: yes Indicates if PR needs to be in release notes labels Jun 19, 2019
@apolcyn apolcyn force-pushed the fix_ares_windows_tcp branch from 400b1e4 to 03797e0 Compare June 19, 2019 21:16
@apolcyn apolcyn marked this pull request as ready for review June 19, 2019 21:28
@apolcyn
Copy link
Copy Markdown
Contributor Author

apolcyn commented Jun 21, 2019

Copy link
Copy Markdown
Member

@markdroth markdroth left a comment

Choose a reason for hiding this comment

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

Approving for ownership. I have not actually reviewed the code; I am relying on Nico to have done that.

@apolcyn
Copy link
Copy Markdown
Contributor Author

apolcyn commented Jun 26, 2019

macos c/C++: #19469
interop cloud to cloud: #16580
interop cloud to prod: #16580

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

lang/core release notes: yes Indicates if PR needs to be in release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants