mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 19:25:56 +03:00
[GH-ISSUE #1669] Using a custom UdpSocket will put lookup_ip in a busy loop #733
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#733
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?
Originally created by @spacemeowx2 on GitHub (Mar 25, 2022).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1669
Describe the bug
In my scenario I need to use a custom UdpSocket to make it pass through a proxy, requesting a DNS server.
I found that I can't use
awaitintrust_dns_proto::udp::UdpSocket::bind, otherwise the program will get stuck.To Reproduce
Cargo.tomllib/main.rsExpected behavior
I should be able to use
awaitintrust_dns_proto::udp::UdpSocket::bindSystem:
Version:
Crate: resolver
Version: 0.21.1
Additional context
I think the root cause is here:
github.com/bluejekyll/trust-dns@b470913512/crates/proto/src/udp/udp_stream.rs (L238-L240)It assumes that
Udp::bindis done immediately, so each return ofPoll::Pendingcauses the loop to restart andFutureto be recreated, so the state is lost@spacemeowx2 commented on GitHub (Mar 25, 2022):
I found that
NextRandomUdpSocketis always immediatelyawaitor boxed byBox::new, can thisFuturebe rewritten toasync fnto solve this issue?@bluejekyll commented on GitHub (Mar 25, 2022):
I think there are two questions here:
We need to add an additional "state" of "connect" to the Future. And this would be easier to do with an
async fnasync fn?Yes, absolutely, it's just old code. I haven't looked, but we might need to use
async_traitto allow that. If that's a problem, we can always box a dyn Future for that use case, if theasync_traitchange spider-webs out significantly.@divergentdave commented on GitHub (Nov 21, 2024):
This was fixed by #2464. If the bind future returns
Pending, it will now be saved and polled until ready. I think this can be closed.