diff options
author | Corey Hulen <corey@hulen.com> | 2017-04-04 11:42:07 -0700 |
---|---|---|
committer | Harrison Healey <harrisonmhealey@gmail.com> | 2017-04-04 14:42:07 -0400 |
commit | 6bf080393d88534aa658ecaff32ae089bd304772 (patch) | |
tree | be25ba4cea3d687d11fe49537b84fae4bf21a484 /utils | |
parent | 32460bf63bc07c69ee5da0bb5640b879facb5538 (diff) | |
download | chat-6bf080393d88534aa658ecaff32ae089bd304772.tar.gz chat-6bf080393d88534aa658ecaff32ae089bd304772.tar.bz2 chat-6bf080393d88534aa658ecaff32ae089bd304772.zip |
Fixing race conditions in the code base (#5966)
* Adding initial race detector
* Remove setting of config twice
* Fixing config file watch and config reload on license save
* Fixing config file watch and config reload on license save
* Fixing build error
* Fixing locking issue
* Fixing makefile
* Fixing race in config
* Fixing race in status unit test
* Adding EE race tests
* Fixing race in cluster info
* Removing code that's isn't needed
* Fixing some more races
* Fixing govet issue
Diffstat (limited to 'utils')
-rw-r--r-- | utils/config.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/utils/config.go b/utils/config.go index cecc7a361..2e41f8431 100644 --- a/utils/config.go +++ b/utils/config.go @@ -72,6 +72,8 @@ func FindDir(dir string) string { } func DisableDebugLogForTest() { + cfgMutex.Lock() + defer cfgMutex.Unlock() if l4g.Global["stdout"] != nil { originalDisableDebugLvl = l4g.Global["stdout"].Level l4g.Global["stdout"].Level = l4g.ERROR @@ -79,6 +81,8 @@ func DisableDebugLogForTest() { } func EnableDebugLogForTest() { + cfgMutex.Lock() + defer cfgMutex.Unlock() if l4g.Global["stdout"] != nil { l4g.Global["stdout"].Level = originalDisableDebugLvl } |