mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 11:15:54 +03:00
[PR #1923] [CLOSED] Add AsyncResolverBuilder and option to overide a pre-created cache #2699
Labels
No labels
blocked
breaking-change
bug
bug:critical
bug:tests
cleanup
compliance
compliance
compliance
crate:all
crate:client
crate:native-tls
crate:proto
crate:recursor
crate:resolver
crate:resolver
crate:rustls
crate:server
crate:util
dependencies
docs
duplicate
easy
easy
enhance
enhance
enhance
feature:dns-over-https
feature:dns-over-quic
feature:dns-over-tls
feature:dnsssec
feature:global_lb
feature:mdns
feature:tsig
features:edns
has workaround
ops
perf
platform:WASM
platform:android
platform:fuchsia
platform:linux
platform:macos
platform:windows
pull-request
question
test
tools
tools
trust
unclear
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hickory-dns#2699
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/hickory-dns/hickory-dns/pull/1923
Author: @hottea773
Created: 4/28/2023
Status: ❌ Closed
Base:
main← Head:main📝 Commits (2)
67a98f9Add AsyncResolverBuilder to allow sharing a cached9612ebMake AsyncResolverBuilder fully-featured📊 Changes
3 files changed (+205 additions, -52 deletions)
View changed files
📝
Cargo.lock(+37 -0)📝
crates/resolver/src/async_resolver.rs(+166 -50)📝
crates/resolver/src/lib.rs(+2 -2)📄 Description
This PR adds the ability to share a DNS Cache between different
AsyncResolvers. It also add anAsyncResolverBuilderto avoid adding yet morenew_with_...methods to theAsyncResolver.The rough reasoning behind it was that we've got a few different threads running all of which need to make DNS requests, but we didn't want to be making unnecessary requests if we've already done a previous lookup; hence a desire for multiple
AsyncResolvers to shared their cache.Since we did this work initially, I've thought that perhaps we could just have each thread use a
cloneof an initialAsyncResolver, which would mean that they shared the cache, since it's anArc, so perhaps this change is unnecessary?So I guess I have a question for reviewers:
Would there be any performance (or other) impact to using cloned
AsyncResolveracross multiple threads at the same time. Looking through the struct, I see that there are a few other items behindArcs, such as https://github.com/bluejekyll/trust-dns/blob/main/crates/resolver/src/name_server/name_server_pool.rs#L39-L40 which I fear might cause some kind of issues, but don't really feel like I know enough to know.If you don't think there would be any impact from that, then this PR is probably unnecessary (unless you disagree).
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.