Skip to content

dns: add environment variable to disable TXT lookups in DNS resolver #8377

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dfawley
Copy link
Member

@dfawley dfawley commented Jun 2, 2025

Fixes #8356

Note that there is no way to force TXT lookups happen for a specific channel. If someone requests this feature, we can consider it at that time, but I don't imagine there will be demand for it.

RELEASE NOTES:

  • dns: add an environment variable (GRPC_ENABLE_TXT_SERVICE_CONFIG) to provide a way to disable TXT lookups in the DNS resolver (by setting it to false). By default, TXT lookups are enabled, as they were before this change.

Copy link

codecov bot commented Jun 2, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.25%. Comparing base (9b7bd34) to head (e8f65b8).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8377      +/-   ##
==========================================
+ Coverage   82.18%   82.25%   +0.06%     
==========================================
  Files         419      419              
  Lines       42073    42073              
==========================================
+ Hits        34579    34606      +27     
+ Misses       6028     6008      -20     
+ Partials     1466     1459       -7     
Files with missing lines Coverage Δ
internal/envconfig/envconfig.go 100.00% <ø> (ø)
internal/resolver/dns/dns_resolver.go 88.34% <100.00%> (ø)

... and 27 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dfawley dfawley added the Type: Feature New features or improvements in behavior label Jun 2, 2025
@dfawley dfawley added this to the 1.74 Release milestone Jun 2, 2025
@dfawley dfawley requested a review from arjan-bal June 3, 2025 20:06
@eshitachandwani
Copy link
Member

Would it make sense to rename GRPC_ENABLE_TXT_SERVICE_CONFIG to something like GRPC_DISABLE_TXT_SERVICE_CONFIG since the default behavior is that TXT lookups are enabled? Just thinking it might better reflect the default behavior and make it clearer when someone wants to opt out.

@arjan-bal
Copy link
Contributor

Would it make sense to rename GRPC_ENABLE_TXT_SERVICE_CONFIG to something like GRPC_DISABLE_TXT_SERVICE_CONFIG since the default behavior is that TXT lookups are enabled? Just thinking it might better reflect the default behavior and make it clearer when someone wants to opt out.

In most cases, we should try to have boolean variables indicate the positive case. This makes it easier to read the the code when they're used in more complex boolean expressions. See this readability tip.

Copy link
Contributor

@arjan-bal arjan-bal left a comment

Choose a reason for hiding this comment

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

Can you please add a test for verifying that txt lookups are disabled when the env var is set? It should be possible to add a new boolean param to the existing test which controls setting of envconfig.EnableTXTServiceConfig.

func (s) TestDisableServiceConfig(t *testing.T) {

@arjan-bal arjan-bal assigned dfawley and unassigned arjan-bal Jun 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature New features or improvements in behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Grpc DNS resolver timing out for simple localhost lookup
3 participants