Skip to content
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

copy rrs #4416

Merged
merged 3 commits into from
Jan 28, 2021
Merged

copy rrs #4416

merged 3 commits into from
Jan 28, 2021

Conversation

miekg
Copy link
Member

@miekg miekg commented Jan 21, 2021

miekg added 2 commits January 21, 2021 10:47
See #4409 and the comments. This documents that issue, but doesn't
change the in-tree plugins just yet.

Signed-off-by: Miek Gieben <[email protected]>
@miekg
Copy link
Member Author

miekg commented Jan 21, 2021

cc @chrisohaver

@chrisohaver
Copy link
Member

Is there a potential write/read race condition here when a plugin such as file or auto is updating an RR in the tree, at the same time the response writer is reading that RR?

@miekg
Copy link
Member Author

miekg commented Jan 21, 2021 via email

@miekg
Copy link
Member Author

miekg commented Jan 21, 2021 via email

@chrisohaver
Copy link
Member

although file doesn't update a single RR (no dynamic updates)

Right - I suppose it replaces the entire tree, leaving the previous tree to be GC'ed. I see in file that only the tree/apex pointers are locked, not the contents of the trees. So, I think it's safe as is.

Ultimately, putting the responsibility of fixing this on response writers seems better because it only copies when needed.

@miekg
Copy link
Member Author

miekg commented Jan 23, 2021 via email

Co-authored-by: Chris O'Haver <[email protected]>
@codecov-io
Copy link

Codecov Report

Merging #4416 (3da6c53) into master (eba7438) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4416      +/-   ##
==========================================
- Coverage   55.35%   55.34%   -0.01%     
==========================================
  Files         223      223              
  Lines        9938     9936       -2     
==========================================
- Hits         5501     5499       -2     
  Misses       3979     3979              
  Partials      458      458              
Impacted Files Coverage Δ
plugin/file/lookup.go 71.71% <100.00%> (-0.29%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update eba7438...3da6c53. Read the comment docs.

@miekg
Copy link
Member Author

miekg commented Jan 28, 2021

still needs fixed in rewrite

@miekg miekg merged commit 60e1490 into master Jan 28, 2021
@miekg miekg deleted the copy-rrs branch January 28, 2021 15:50
@chrisohaver
Copy link
Member

still needs fixed in rewrite

was expecting that to be added to this pr before it merged ...

@chrisohaver
Copy link
Member

@miekg , Should we open an issue so we don't forget about it? Or do you have a fix in the works already?

@miekg
Copy link
Member Author

miekg commented Jan 28, 2021 via email

@miekg
Copy link
Member Author

miekg commented Jan 28, 2021 via email

michael2008 pushed a commit to michael2008/coredns that referenced this pull request Feb 9, 2021
* upstream/master: (289 commits)
  auto go mod tidy
  build(deps): bump github.com/miekg/dns from 1.1.37 to 1.1.38 (coredns#4459)
  build(deps): bump github.com/aws/aws-sdk-go from 1.37.1 to 1.37.6 (coredns#4458)
  build(deps): bump github.com/Azure/go-autorest/autorest/azure/auth (coredns#4457)
  plugin/transfer: only allow outgoing axfr over tcp (coredns#4452)
  plugin/rewrite: copy msg before rewritting (coredns#4443)
  plugin/acl: add the ability to filter records (coredns#4389)
  build(deps): bump github.com/miekg/dns from 1.1.35 to 1.1.37 (coredns#4442)
  build(deps): bump github.com/aws/aws-sdk-go from 1.36.31 to 1.37.1 (coredns#4441)
  Makefile.release: Replace manifest-tool with docker manifest (coredns#4421)
  copy rrs (coredns#4416)
  plugin/trace - Use compatible tag name for datadog (coredns#4408)
  auto make -f Makefile.doc
  plugin/forward Add rcode and rtype to request_duration_seconds metric (coredns#4391)
  modify the error url of DWF (coredns#4425)
  modify the error url of hualala (coredns#4426)
  Corrected detection of K8s minor version (coredns#4430)
  core: flag blacklisting not needed anymore (coredns#4420)
  auto go mod tidy
  build(deps): bump github.com/aws/aws-sdk-go from 1.36.28 to 1.36.31 (coredns#4424)
  ...
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.

3 participants