fix(cache): refresh honors forwarding rules (#147) #150
Reference in New Issue
Block a user
Delete Branch "fix/refresh-honors-forwarding-rules"
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?
Summary
refresh_entrynow consultsmatch_forwarding_rulebefore falling through to recursive/default-upstream resolution, matching the precedence already enforced inresolve_query.cache.min_ttl(60s default). On a busy resolver the cycle was continuous; a restart restored service until the next refresh. Reporter in #147 observed this for both a private TLD and itsin-addr.arpazone, and worked around it with hardcoded zone entries (which win over cache in the pipeline).refresh_entry_honors_forwarding_rule(default pool points at a blackhole — only the rule's mock upstream can satisfy the refresh) andrefresh_entry_prefers_forwarding_rule_over_recursive(Recursive mode with emptyroot_hints— recursion would fail immediately, proving the rule branch fired).testutil::a_record_response()for the mock-response boilerplate and migrated six call sites (two new + four adjacent tests).Test plan
cargo test --lib ctx::tests— 33/33 pass, including both new regression testsmake all— fmt, clippy, audit, build, full suite (356 unit + 1 integration)Fixes #147