mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 03:05:51 +03:00
[GH-ISSUE #2570] Separate high level errors and referrals out of ProtoErrorKind #1018
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#1018
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 @divergentdave on GitHub (Nov 12, 2024).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/2570
Originally posted by @djc in https://github.com/hickory-dns/hickory-dns/issues/2546#issuecomment-2456693095
I agree that we should remove some of these variants from
ProtoErrorKind, and put them in a different enum. Specifically,Nsec,NoError,NoRecordsFound, should be removed, while transport-level errors and parsing errors should stay. Likewise, theForwardandForwardNSvariants should be removed fromhickory_recursor::ErrorKind. Propagation of negative responses and referrals has been bug-prone because of how high-level and low-level concerns are combined in these error types. The immediate cause of many such bugs has been a failure to match on specific error kind variants in various places. IfProtoErroronly contains transport errors and the like, then it will be safe to just propagate it with?.In the case of the recursor, recursor errors have to be transformed into
ProtoErrors before being passed to the DNSSEC validator, due to the use of theDnsHandletrait, which requires complicated conversions between variants of different error types. If we had one common enum to represent presence of records, absence of records, absence of domain, or a referral, then we could reuse this throughout different crates, and crate-wide error representations would not need to be involved.The DnsLru cache would benefit from such a change as well, since it currently uses a
Result<Lookup, ProtoError>, but only ever populates the error case withNoRecordsFounderrors.@divergentdave commented on GitHub (Nov 12, 2024):
Here's a related blog post: https://sled.rs/errors.html
@djc commented on GitHub (Nov 13, 2024):
Yes, I think we should maybe stop using the
DnsHandletrait in all the places or make it more flexible? Started pulling on that thread on a branch but there's a lot of tight coupling and a bunch of low-value abstractions that make stuff harder.https://github.com/hickory-dns/hickory-dns/compare/handle-error?expand=1