mirror of
https://github.com/status-im/consul.git
synced 2025-01-22 11:40:06 +00:00
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.
This commit is contained in:
parent
970f5d78ec
commit
0acfc2c65b
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user