Skip to content

dns: preserve failures in dual-family resolution - #47494

Merged
yanavlasov merged 2 commits into
envoyproxy:mainfrom
yuchen3642:fix/cares-empty-result-on-error
Oct 1, 2026
Merged

yanavlasov merged 2 commits into
envoyproxy:mainfrom
yuchen3642:fix/cares-empty-result-on-error

Conversation

@yuchen3642

@yuchen3642 yuchen3642 commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

In AUTO and V4_PREFERRED mode, the c-ares resolver falls back to the other address family when the first lookup returns no addresses. Previously a no-records response (ARES_ENODATA/ARES_ENOTFOUND) from either lookup marked the combined result Completed even when the other lookup failed (e.g. ARES_ETIMEOUT), so strict DNS clusters treated it as a successful empty resolution and dropped all their hosts.

The resolver now tracks failures across both lookups and reports Failure when a lookup failed and no addresses were obtained. A successful fallback still returns its addresses, two no-records responses still return a successful empty result, and a family skipped by filter_unroutable_families is not counted as a failure. Revert with the runtime guard envoy.reloadable_features.cares_dual_resolution_preserve_failure set to false.

Risk Level: Low. Small c-ares bug fix behind a runtime guard.

Testing: Updated the two NoRecordsDoNotMaskError* tests (renamed from FallbackToNodataWithError*) to expect Failure; added SuccessfulFallbackAfterError and NoRecordsMaskErrorWithRuntimeGuardDisabled. dns_impl_test passes for IPv4 and IPv6.

Docs Changes: Documented dual-family failure handling in docs/root/intro/arch_overview/upstream/dns_resolution.rst.

Release Notes: Added changelogs/current/bug_fixes/dns_resolver__dual_resolution_failure.rst.

Platform Specific Features: N/A

Runtime guard: envoy.reloadable_features.cares_dual_resolution_preserve_failure (default true)

Fixes #38752

AI assistance: Codex assisted with the initial fix and tests; Claude assisted with the runtime guard follow-up and this description.

Signed-off-by: Yuchen Wang <162491048+yuchen-db@users.noreply.github.com>
@repokitteh-read-only

Copy link
Copy Markdown

Hi @yuchen-db, welcome and thank you for your contribution.

We will try to review your Pull Request as quickly as possible.

In the meantime, please take a look at the contribution guidelines if you have not done so already.

🐱

Caused by: #47494 was opened by yuchen-db.

see: more, trace.

@agrawroh

Copy link
Copy Markdown
Member

/assign @yanavlasov

@yanavlasov

Copy link
Copy Markdown
Contributor

@yuchen-db thanks for the change. I looks good to me. I can't think how this can break anyone, but it would make this change safer if there was a runtime flag to revert back to the old behavior. Can you please add it?

/wait

Guard the new c-ares behavior behind
envoy.reloadable_features.cares_dual_resolution_preserve_failure so it
can be reverted to the previous behavior, and add a test covering the
guard-disabled path.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Yuchen Wang <162491048+yuchen-db@users.noreply.github.com>
@yuchen3642
yuchen3642 deployed to external-contributors September 24, 2026 20:26 — with GitHub Actions Active
@repokitteh-read-only

Copy link
Copy Markdown

CC @envoyproxy/runtime-guard-changes: FYI only for changes made to (source/common/runtime/runtime_features.cc).

🐱

Caused by: #47494 was synchronize by yuchen3642.

see: more, trace.

@yuchen3642

Copy link
Copy Markdown
Contributor Author

@yuchen-db thanks for the change. I looks good to me. I can't think how this can break anyone, but it would make this change safer if there was a runtime flag to revert back to the old behavior. Can you please add it?

/wait

thanks! added a runtime flag

@yanavlasov
yanavlasov enabled auto-merge (squash) September 30, 2026 02:37
@yuchen3642

Copy link
Copy Markdown
Contributor Author

/retest

1 similar comment
@yuchen3642

Copy link
Copy Markdown
Contributor Author

/retest

@yanavlasov
yanavlasov merged commit a4fe4d6 into envoyproxy:main Oct 1, 2026
25 checks passed

This branch was successfully deployed

1 active deployment
external-contributors — e3468312 Deployed Sep 24, 2026 by yuchen3642 via authorize #57090
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: dns: c-ares: timeouts in dual-resolution can result in "no unhealthy backends"

3 participants