From 0c0638b080cf1565fc4e5b7ee3fd35c36ae5832a Mon Sep 17 00:00:00 2001 From: Dmitry Shmulevich Date: Thu, 13 Jun 2019 12:55:08 -0700 Subject: [PATCH] resolve race condition in maxGauge (#5647) * resolve race condition in maxGauge Signed-off-by: Dmitry Shmulevich --- storage/remote/max_gauge.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/storage/remote/max_gauge.go b/storage/remote/max_gauge.go index a2b2ccb0e..a56c2047d 100644 --- a/storage/remote/max_gauge.go +++ b/storage/remote/max_gauge.go @@ -35,5 +35,7 @@ func (m *maxGauge) Set(value float64) { } func (m *maxGauge) Get() float64 { + m.mtx.Lock() + defer m.mtx.Unlock() return m.value }