docs: fix DNS lookup delay from IPv6 resolver stall#6033
Conversation
The getting-started guide only configures IPv4 networking for the guest, but glibc's resolver still attempts parallel A/AAAA lookups by default. If the host has IPv6 connectivity, the guest's IPv6 query stalls until timeout before falling back to IPv4, adding several seconds to every DNS lookup (see firecracker-microvm#5512). Setting 'single-request-reopen' in resolv.conf makes the resolver issue A and AAAA queries sequentially over separate sockets, avoiding the stall. Tested with ./tools/devtool checkstyle — all style/markdown checks passed, including test_markdown_style and test_markdown_internal_links. Signed-off-by: RyanJHamby <ryanhamby22@gmail.com>
|
Thanks for picking this up,
|
|
|
||
| # This guide only configures IPv4 networking for the guest. If the host has | ||
| # IPv6 connectivity, glibc's resolver will attempt parallel A/AAAA lookups by | ||
| # default, and the IPv6 attempt will stall until it times out before falling |
There was a problem hiding this comment.
the IPv6 attempt will stall until it times out reads a bit strong; it's intermittent and kernel dependent, so to me 'can stall' is more accurate.
There was a problem hiding this comment.
Thanks for the review. Updated the comment to your suggested wording.
On single-request-reopen versus single-request: single-request serializes the two queries but keeps the same source port, so if the drop is happening on the 5-tuple, which is the case here, reusing the port does not change anything and the second query still stalls. single-request-reopen closes and reopens the socket between queries, so the AAAA query goes out on a fresh source port with a distinct 5-tuple, which is what actually avoids the stall. I will add this explanation to the PR description as well.
Shortens the inline comment explaining the single-request-reopen fix per review feedback on firecracker-microvm#6033, and softens 'will stall until it times out' to 'can stall', since the behavior is intermittent and kernel dependent rather than guaranteed. Tested with ./tools/devtool checkstyle — all style/markdown checks passed, including test_markdown_style and test_markdown_internal_links. Signed-off-by: RyanJHamby <ryanhamby22@gmail.com>
Changes
Adds a
resolv.confsingle-request-reopenoption to the guest networksetup steps in
docs/getting-started.md.Reason
Closes #5512. The getting-started guide only configures IPv4 networking
for the guest. glibc's resolver still attempts parallel A/AAAA DNS
lookups by default, and on an IPv6-connected host the AAAA query can
stall on host NAT, adding seconds per lookup.
single-requestalone only serializes the two queries but keeps themon the same source port, so it doesn't help when the drop is on the
5-tuple itself, which is the usual case here.
single-request-reopencloses and reopens the socket between the two queries, so the second
query goes out on a fresh source port with a distinct 5-tuple, which
is what actually avoids the stall. This was confirmed as the fix by
the issue reporter, and a maintainer invited a documentation PR for it.
License Acceptance
By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license. For more information on following Developer
Certificate of Origin and signing off your commits, please check
CONTRIBUTING.md.PR Checklist
tools/devtool checkbuild --allto verify that the PR passesbuild checks on all supported architectures. (N/A — docs-only change, no
Rust code touched; skipped since it doesn't exercise this change)
tools/devtool checkstyleto verify that the PR passes theautomated style checks. (
test_markdown_styleandtest_markdown_internal_linksboth passed)how they are solving the problem in a clear and encompassing way.
in the PR.
CHANGELOG.md. (docs-onlyfix to a getting-started walkthrough; please advise if this warrants an
entry)
Runbook for Firecracker API changes. (N/A — no API changes)
integration tests. (N/A — docs-only change, not applicable to unit/integration
tests; verified via markdown style checks instead)
TODO. (N/A — no new TODOs added)rust-vmm. (N/A — this is adocumentation fix, not new functionality)