Skip to content

Commit e5cd820

Browse files
fix data race in memory.update (#2802)
Co-authored-by: ExtinctPatronageDeodorize <[email protected]>
1 parent 479bd58 commit e5cd820

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

config/loader/memory/memory.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,12 @@ func (m *memory) update() {
183183

184184
val, _ := vals.Get(w.path...)
185185

186+
m.RLock()
186187
uv := updateValue{
187188
version: m.snap.Version,
188189
value: val,
189190
}
191+
m.RUnlock()
190192

191193
select {
192194
case w.updates <- uv:

0 commit comments

Comments
 (0)