mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 03:05:51 +03:00
[PR #481] [CLOSED] resolver: Make ResolverFuture::lookup_ip lazier #1469
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#1469
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/481
Author: @hawkw
Created: 5/21/2018
Status: ❌ Closed
Base:
master← Head:eliza/lazily-lookup-ip📝 Commits (2)
c58722bresolver: MakeResolverFuture::lookup_iplazierc22ee4eMerge branch 'master' into eliza/lazily-lookup-ip📊 Changes
2 files changed (+108 additions, -88 deletions)
View changed files
📝
resolver/examples/global_resolver.rs(+5 -1)📝
resolver/src/resolver_future.rs(+103 -87)📄 Description
This PR refactors the implementation of
ResolverFuture::lookup_ipto lazilyprepare the
LookupIpFuturewhen the returned future starts executing, ratherthan eagerly when that function is called.
I took the simpler approach here and simply wrapped the preparation in a
future::lazy, rather than changing the implementation ofLookupIpFuture.This is because a number of Trust-DNS' tests construct
LookupIpFutureswithout first constructing a
ResolverFuture, and changingLookupIpFutureto do all the preparation done by
ResolverFuture::lookup_ipwould introducea significant amount of additional complexity to avoid breaking these tests.
Notably, the use of
future::lazyhere changes the return type fromResolverFuture::lookup_iptoimpl Future<...>rather than a concrete type.If this API change is problematic downstream, we could add a new future type
that does the preparation and then becomes a
LookupIpFuture, like I didoriginally in hawkw/trust-dns@a76769e25f. I found
that this change makes the code more complex, but if being able to return a
concrete named type here presents a singificantly better API surface, I'd be
happy to change this branch to do that instead.
Closes #430
Signed-off-by: Eliza Weisman eliza@buoyant.io
/cc @briansmith
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.