Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Kentzo
Copy link
Contributor

@Kentzo Kentzo commented Aug 31, 2025

1. Why is this pull request needed and what does it do?

Before dnsserver.Server starts dns.Server (that actually serves TCP connections) it considers all server blocks in Corefile that apply to a given listening endpoint before picking the final timeout values (only one value gets applied, all other are silently disregarded). Unfortunately this happens after plugins are set up.

I'm currently working on a plugin that implements RFC 8490. This protocol allows to communicate to the client that it needs to send KeepAlive messages to maintain the TCP connection. Since dns.Server will terminate an idle tcp connection, I need to communicate a value that's sufficient to prevent that. Therefore inside plugin's ServeDNS I need to be able to access actual IdleTimeout used by dnsserver.Server (and, by extension, dns.Server).

2. Which issues (if any) are related?

None

3. Which documentation changes (if any) need to be made?

None

4. Does this introduce a backward incompatible change or deprecation?

No

@codecov
Copy link

codecov bot commented Aug 31, 2025

Codecov Report

❌ Patch coverage is 43.75000% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.11%. Comparing base (93c57b6) to head (127a11d).
⚠️ Report is 1628 commits behind head on master.

Files with missing lines Patch % Lines
core/dnsserver/server.go 33.33% 6 Missing ⚠️
core/dnsserver/server_tls.go 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7497      +/-   ##
==========================================
+ Coverage   55.70%   60.11%   +4.41%     
==========================================
  Files         224      274      +50     
  Lines       10016    18143    +8127     
==========================================
+ Hits         5579    10907    +5328     
- Misses       3978     6601    +2623     
- Partials      459      635     +176     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

Plugins need access to timeout values that are actually used by
TCP dns.Server

Signed-off-by: Ilya Kulakov <[email protected]>
@Kentzo Kentzo force-pushed the dnsserver-timeout branch from 2edc894 to 127a11d Compare August 31, 2025 19:31
@yongtang yongtang merged commit c90e703 into coredns:master Sep 10, 2025
12 of 13 checks passed
@Kentzo Kentzo deleted the dnsserver-timeout branch October 3, 2025 19:40
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.

2 participants