asyn-ares, connects async#21205
Closed
icing wants to merge 2 commits into
Closed
Conversation
Make separate queries for A and AAAA records. Hand out A/AAAA/HTTPS information before all queries are complete.
bagder
approved these changes
Apr 8, 2026
There was a problem hiding this comment.
Pull request overview
This PR updates the async DNS resolver behavior (notably the c-ares backend) to issue separate A and AAAA queries and make partial DNS information available earlier, enabling connection attempts to begin as soon as the first relevant DNS response arrives.
Changes:
- Adjust test skipping so most resolve tests also run under c-ares, while keeping the thread-specific test skipped.
- Update a DNS cache test case to use a reserved
.invalidhostname. - Refactor c-ares async resolver to track A and AAAA results separately and expose per-family addrinfo during ongoing resolution, with added DNS trace logging.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/http/test_21_resolve.py | Narrows c-ares skip to only the thread-specific resolve test. |
| tests/data/test2104 | Switches test host to .invalid and updates expected DNS query hostnames. |
| lib/hostip.c | Adds more detailed DNS tracing and handles “incomplete” async results without treating them as errors. |
| lib/asyn.h | Updates c-ares async context to store separate A/AAAA results. |
| lib/asyn-ares.c | Implements separate A/AAAA queries, stores per-family results, and exposes partial addrinfo during ongoing resolution. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Make separate queries for A and AAAA records. Hand out A/AAAA/HTTPS information before all queries are complete. This allows connect attempts to start on the first A or AAAA response received.