writecache: Fix race condition when reporting cache size metrics #1648
1 changed files with 3 additions and 0 deletions
|
@ -87,6 +87,9 @@ func (c *cache) pushToFlushQueue(ctx context.Context, fl *flushLimiter) {
|
||||||
}
|
}
|
||||||
|
|
||||||
c.modeMtx.RUnlock()
|
c.modeMtx.RUnlock()
|
||||||
|
|
||||||
|
// counter changed by fstree
|
||||||
|
c.estimateCacheSize()
|
||||||
case <-ctx.Done():
|
case <-ctx.Done():
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue