prevent races when reloading, fully shut down raft

This commit is contained in:
Chelsea Holland Komlo
2017-11-28 12:33:46 -05:00
parent d4754d541b
commit 184fbfe5bd
3 changed files with 32 additions and 28 deletions

View File

@@ -803,6 +803,9 @@ func (a *Agent) Reload(newConfig *Config) error {
// GetConfigCopy creates a replica of the agent's config, excluding locks
func (a *Agent) GetConfig() *Config {
a.configLock.Lock()
defer a.configLock.Unlock()
return a.config
}