coredns icon indicating copy to clipboard operation
coredns copied to clipboard

forward: respect context

Open Snawoot opened this issue 2 years ago • 1 comments

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

  1. Stop useless query attempts when context is already expired.
  2. Allows to control effective forward timeout with cancel plugin.

2. Which issues (if any) are related?

Related #4493

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

None, it's close to correct behaviour we would naturally expect.

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

No, there is no way one could successfully query some server relying on canceled context as base context for their queries.

Snawoot avatar Jan 30 '24 11:01 Snawoot

Codecov Report

Attention: 770 lines in your changes are missing coverage. Please review.

Comparison is base (93c57b6) 55.70% compared to head (0d3b3ca) 58.46%. Report is 1125 commits behind head on master.

Files Patch % Lines
core/dnsserver/server_quic.go 9.13% 177 Missing and 2 partials :warning:
core/dnsserver/register.go 0.00% 93 Missing :warning:
core/dnsserver/server.go 15.05% 72 Missing and 7 partials :warning:
plugin/backend_lookup.go 0.00% 37 Missing :warning:
plugin/forward/dnstap.go 0.00% 30 Missing :warning:
plugin/dnstap/setup.go 76.59% 17 Missing and 5 partials :warning:
core/dnsserver/quic.go 23.07% 20 Missing :warning:
plugin/dnssec/cache.go 32.00% 17 Missing :warning:
plugin/forward/setup.go 77.33% 12 Missing and 5 partials :warning:
core/dnsserver/onstartup.go 30.00% 14 Missing :warning:
... and 42 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6483      +/-   ##
==========================================
+ Coverage   55.70%   58.46%   +2.76%     
==========================================
  Files         224      252      +28     
  Lines       10016    16568    +6552     
==========================================
+ Hits         5579     9687    +4108     
- Misses       3978     6290    +2312     
- Partials      459      591     +132     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Feb 04 '24 15:02 codecov[bot]