fix: reduce hosts plugin refresh interval
Summary
- reduce the AKS LocalDNS hosts setup timer refresh interval from 15 minutes to 10 seconds
- tighten timer accuracy from 1 minute to 1 second so the shorter cadence is honored
- update the timer comments to describe the new refresh behavior
Validation
- git diff --check
- systemd-analyze verify parts/linux/cloud-init/artifacts/aks-localdns-hosts-setup.timer
- docker run --rm -v "/home/sakwa/agentbaker:/src" shellspec-docker --shell bash --format d spec/parts/linux/cloud-init/artifacts/cse_config_spec.sh
why 10s? we went from 15min to 10s — that's ~90x more frequent. some concerns before this lands:
-
load math. on a 1000-node cluster × ~10s period × N critical FQDNs = ~100N dig qps against upstream.
RandomizedDelaySec=5sonly spreads across 5s of a 10s window, so peak smoothing is ~50%. what's the typical critical-FQDN count, and have we measured this against VNet DNS / 168.63.129.16 headroom? agentbaker #7797 is the precedent — provisioning-timing changes that affect upstream load need a production metric + canary before fleet rollout. -
OnUnitInactiveSecvsOnUnitActiveSec. you also changed the semantics.OnUnitInactiveSec=10sfires 10s after the script completes, not every 10s. Ifaks-localdns-hosts-setup.shtakes 3–5s (multiple dig calls withtimeout 3, can retry across upstream servers), the effective period is ~13–15s. Either is fine, but the inline comment still says "10 seconds after each run completes" —OnUnitActiveSecwould actually deliver the "every ~10s" reading more people expect. Pick one and make the comment match the semantics. -
AccuracySec=1s. default is 1min, which lets systemd coalesce wake-ups across timers. dropping to 1s defeats that batching — small per-node cost but real at fleet scale and not free on battery-constrained / low-end SKUs. is 1s accuracy actually load-bearing here when the wall-clock target is ~10s and the script itself takes longer than that? -
why 10s specifically? the prior comment said "15 minutes balances freshness against unnecessary DNS traffic" — that's gone now. what data drove 10s vs 30s vs 1min? if there was a specific stale-IP incident, link the ICM so the next person reading this
.timerknows what 10s is calibrated against and when it can be relaxed again. -
e2e / perf signal. plan to canary on a small region and watch (a) upstream DNS qps, (b) node CPU/journald write rate from the per-run script logs, (c) any drift in
aks-localdns-hosts-setup.servicefailures before rolling everywhere?
why 10s? we went from 15min to 10s — that's ~90x more frequent. some concerns before this lands:
- load math. on a 1000-node cluster × ~10s period × N critical FQDNs = ~100N dig qps against upstream.
RandomizedDelaySec=5sonly spreads across 5s of a 10s window, so peak smoothing is ~50%. what's the typical critical-FQDN count, and have we measured this against VNet DNS / 168.63.129.16 headroom? agentbaker fix: run aptmarkwalinuxagent hold operation on foreground #7797 is the precedent — provisioning-timing changes that affect upstream load need a production metric + canary before fleet rollout.OnUnitInactiveSecvsOnUnitActiveSec. you also changed the semantics.OnUnitInactiveSec=10sfires 10s after the script completes, not every 10s. Ifaks-localdns-hosts-setup.shtakes 3–5s (multiple dig calls withtimeout 3, can retry across upstream servers), the effective period is ~13–15s. Either is fine, but the inline comment still says "10 seconds after each run completes" —OnUnitActiveSecwould actually deliver the "every ~10s" reading more people expect. Pick one and make the comment match the semantics.AccuracySec=1s. default is 1min, which lets systemd coalesce wake-ups across timers. dropping to 1s defeats that batching — small per-node cost but real at fleet scale and not free on battery-constrained / low-end SKUs. is 1s accuracy actually load-bearing here when the wall-clock target is ~10s and the script itself takes longer than that?- why 10s specifically? the prior comment said "15 minutes balances freshness against unnecessary DNS traffic" — that's gone now. what data drove 10s vs 30s vs 1min? if there was a specific stale-IP incident, link the ICM so the next person reading this
.timerknows what 10s is calibrated against and when it can be relaxed again.- e2e / perf signal. plan to canary on a small region and watch (a) upstream DNS qps, (b) node CPU/journald write rate from the per-run script logs, (c) any drift in
aks-localdns-hosts-setup.servicefailures before rolling everywhere?
- dns server load calculation is off. dns server throttling limit is against per vm, azure dns is 1000 qps per vm. so number of nodes does not matter in this calculation.
- do you dig in parallel? or in batches? OnUnitInactiveSec=10s is fine.
- 1s is fine, since you already randomized delay 5s.
- by design
- n/a
stop re-review
🔎 Linux Gate Detective — build 167687234 failed
Failed job: Run AgentBaker E2E (Stage e2e)
Detective summary
All 10 Test_LocalDNSHostsPlugin* variants (ACL / AzureLinuxV3 / Ubuntu2204 / Ubuntu2404, both default and scriptless_nbc) fail in the in-test validator at validation.go:106 with:
🔴 FAIL: expected exit code 0, but got 1 ERROR: Canary did not resolve after 60s — hot-reload after cold start broken
Failures are uniform across distros and bootstrap modes, exactly on the code path this PR modifies (localdns hosts-plugin refresh interval). Non-hosts-plugin scenarios on the same build cluster are passing, so this is deterministic, not flake.
Class: test failure (E2E) — likely PR-caused product regression
Confidence: High
Signature: localdns-hostsplugin-canary-hotreload-timeout (proposed new)
Wiki: AgentBaker Gate PR Pipeline Flakiness
Strongest alternative theory considered: shared-cluster / test-infra flake. Ruled out — failure is uniform across 10 unrelated VHD flavors and both bootstrap modes, the validator explicitly exercises the modified hosts-plugin hot-reload path, and other tests on the same build run pass. (Separate, unrelated Test_*_NetworkIsolated* / HTTPSProxy_PrivateDNS failures on this build match existing test-infra signatures networkisolated-apiserver-fqdn-nxdomain and httpsproxy-fixture-proxy-unreachable — not PR-caused, not the gate's primary blocker.)
Recommended next action: PR author to revisit the new hosts plugin refresh interval — current value appears to delay hot-reload past the validator's 60s canary timeout after a cold start with an empty hosts file. Suggest verifying the refresh timer fires (and jitter window) within the canary budget, or relaxing the validator timeout if the new interval is intentional.
(Automated by Clawpilot AgentBaker Linux Gate Detective Watcher; signature merge into wiki is handled centrally.)
AgentBaker Linux gate detective
Run: https://msazure.visualstudio.com/CloudNativeCompute/_build/results?buildId=168798000
Failed job/stage/task: Run AgentBaker E2E
Summary: E2E matches the ongoing shared-cluster/fleet outage. LocalDNSHostsPlugin failures occurred with nodes still carrying NetworkUnavailable=True / Waiting for cloud routes, and the shared dual-stack cluster be2e-azure-overlay-dualstack-v6-4a24b later entered Failed/Deleting. Concurrent CIS/SSH lane issues are separate.
Likely cause/signature: shared-cluster-fleet-outage.
Confidence: high.
Strongest alternative: PR #8620's LocalDNS change caused the LocalDNS test failures; less likely because the same run also shows shared cluster lifecycle failure and cloud-route taints across multiple OS/scenarios.
Recommended next action/owner: E2E shared-cluster infra owners; continue repair item https://msazure.visualstudio.com/CloudNativeCompute/_workitems/edit/38373323.
Wiki: shared-cluster-fleet-outage — https://dev.azure.com/msazure/09706533-03bf-4b43-9a9b-b49c75429646/_wiki/wikis/ed4a85e9-1085-4151-a39b-2753523eba2b?pagePath=%2FAKS%2FSIGs%20and%20Teams%2FAKS%20Components%2FSIG%3A%20Node%20Lifecycle%2FAI%20Agent%20Knowledge%2FAgentBaker%20Gate%20PR%20Pipeline%20Flakiness
@C:\Users\SYLVAI~1\AppData\Local\Temp\ab-gate-pr8620-168815871-comment.md