From 0acfc2c65bf48098431fea7e28430873445c7048 Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Tue, 8 Jun 2021 19:25:55 -0400 Subject: [PATCH] agent: fix a data race in DNS tests The dnsConfig pulled from the atomic.Value is a pointer, so modifying it in place creates a data race. Use the exported ReloadConfig interface instead. --- agent/testagent.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/agent/testagent.go b/agent/testagent.go index e4cbae7ce3a7..ee1f7f510f0c 100644 --- a/agent/testagent.go +++ b/agent/testagent.go @@ -345,8 +345,8 @@ func (a *TestAgent) Client() *api.Client { // DNSDisableCompression disables compression for all started DNS servers. func (a *TestAgent) DNSDisableCompression(b bool) { for _, srv := range a.dnsServers { - cfg := srv.config.Load().(*dnsConfig) - cfg.DisableCompression = b + a.config.DNSDisableCompression = b + srv.ReloadConfig(a.config) } }