Merge pull request #2157 from yichengq/309

pkg/metrics: protect global vars in reset func
release-2.0
Xiang Li 2015-01-26 16:24:00 -08:00
commit 825107629a
1 changed files with 2 additions and 0 deletions

View File

@ -158,6 +158,8 @@ func Do(f func(expvar.KeyValue)) {
// for test only
func reset() {
mutex.Lock()
defer mutex.Unlock()
vars = make(map[string]expvar.Var)
varKeys = nil
}