From 0a8b79ad2932d326fa6ee7c01e291c42e263925f Mon Sep 17 00:00:00 2001 From: Marco Pracucci Date: Wed, 27 Sep 2023 15:50:39 +0200 Subject: [PATCH] Do not measure size of sync.WaitGroup Signed-off-by: Marco Pracucci --- tsdb/postings_for_matchers_cache.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tsdb/postings_for_matchers_cache.go b/tsdb/postings_for_matchers_cache.go index 6ac0fc20f..64c7cd0f6 100644 --- a/tsdb/postings_for_matchers_cache.go +++ b/tsdb/postings_for_matchers_cache.go @@ -112,7 +112,7 @@ func (c *PostingsForMatchersCache) postingsForMatchersPromise(ctx context.Contex // Estimate the size of the cache entry, in bytes. We use max() because // size.Of() returns -1 if the value is nil. - estimatedSizeBytes := int64(len(key)) + max(0, int64(size.Of(wg))) + max(0, int64(size.Of(outerErr))) + max(0, int64(size.Of(cloner))) + estimatedSizeBytes := int64(len(key)) + max(0, int64(size.Of(outerErr))) + max(0, int64(size.Of(cloner))) c.created(key, c.timeNow(), estimatedSizeBytes) return promise