Fix race condition issues with provided dynamic configuration
* tests: add tests to show race condition on provider config * fix: store a deep copy of previous provider config * fix: send a deep copy of provdier config to watcher listener
This commit is contained in:
parent
607cda779d
commit
4d71f682b3
2 changed files with 95 additions and 2 deletions
|
@ -224,8 +224,8 @@ func (c *ConfigurationWatcher) throttleProviderConfigReload(ctx context.Context,
|
|||
logger.Info("Skipping same configuration")
|
||||
continue
|
||||
}
|
||||
previousConfig = nextConfig
|
||||
ring.In() <- nextConfig
|
||||
previousConfig = *nextConfig.DeepCopy()
|
||||
ring.In() <- *nextConfig.DeepCopy()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue