From a12bf4b61b7a56f5d1f1823f5c3af490bdd6250d Mon Sep 17 00:00:00 2001 From: Diego Fronza Date: Fri, 11 Dec 2020 16:12:48 -0300 Subject: [PATCH] Adjusted serve-stale test After the addition of stale-answer-client-timeout a test was broken due to the following behavior expected by the test. 1. Prime cache data.example txt. 2. Disable authoritative server. 3. Send a query for data.example txt. 4. Recursive server will timeout and answer from cache with stale RRset. 5. Recursive server will activate stale-refresh-time due to the previous failure in attempting to refresh the RRset. 6. Send a query for data.example txt. 7. Expect stale answer from cache due to stale-refresh-time window being active, even if authoritative server is up. Problem is that in step 4, due to the new option stale-answer-client-timeout, recursive server will answer with stale data before the actual fetch completes. Since the original fetch is still running in background, if we re-enable the authoritative server during that time, the RRset will actually be successfully refreshed, and stale-refresh-window will not be activated. The next queries will fail because they expect the TTL of the RRset to match the one in the stale cache, not the one just refreshed. To solve this, we explicitly disable stale-answer-client-timeout for this test, as it's not the feature we are interested in testing here anyways. --- bin/tests/system/serve-stale/clean.sh | 1 + bin/tests/system/serve-stale/ns1/named1.conf.in | 1 + bin/tests/system/serve-stale/ns1/named2.conf.in | 1 + bin/tests/system/serve-stale/ns1/named3.conf.in | 1 + 4 files changed, 4 insertions(+) diff --git a/bin/tests/system/serve-stale/clean.sh b/bin/tests/system/serve-stale/clean.sh index 5f3c90f540..2784ba25a0 100644 --- a/bin/tests/system/serve-stale/clean.sh +++ b/bin/tests/system/serve-stale/clean.sh @@ -15,3 +15,4 @@ rm -f */named.run */named.memstats rm -f ns*/managed-keys.bind* rm -f ns*/named_dump* rm -f ns*/named.stats* +rm -f ns1/named.run.prev diff --git a/bin/tests/system/serve-stale/ns1/named1.conf.in b/bin/tests/system/serve-stale/ns1/named1.conf.in index 41347871cd..a8410a0e44 100644 --- a/bin/tests/system/serve-stale/ns1/named1.conf.in +++ b/bin/tests/system/serve-stale/ns1/named1.conf.in @@ -30,6 +30,7 @@ options { max-stale-ttl 3600; stale-answer-ttl 4; stale-answer-enable yes; + stale-answer-client-timeout disabled; stale-cache-enable yes; stale-refresh-time 30; servfail-ttl 0; diff --git a/bin/tests/system/serve-stale/ns1/named2.conf.in b/bin/tests/system/serve-stale/ns1/named2.conf.in index 06fae5369c..c8a8daeee1 100644 --- a/bin/tests/system/serve-stale/ns1/named2.conf.in +++ b/bin/tests/system/serve-stale/ns1/named2.conf.in @@ -30,6 +30,7 @@ options { max-stale-ttl 20; stale-answer-ttl 3; stale-answer-enable yes; + stale-answer-client-timeout disabled; stale-cache-enable yes; servfail-ttl 0; }; diff --git a/bin/tests/system/serve-stale/ns1/named3.conf.in b/bin/tests/system/serve-stale/ns1/named3.conf.in index f97dea958d..6fed86ae40 100644 --- a/bin/tests/system/serve-stale/ns1/named3.conf.in +++ b/bin/tests/system/serve-stale/ns1/named3.conf.in @@ -30,6 +30,7 @@ options { max-stale-ttl 20; stale-answer-ttl 3; stale-answer-enable yes; + stale-answer-client-timeout disabled; stale-cache-enable yes; stale-refresh-time 0; servfail-ttl 0;