From c6897726c1b635e5f9077eb742a07a83888bce36 Mon Sep 17 00:00:00 2001 From: Thomas Date: Thu, 27 Mar 2025 09:51:12 +0000 Subject: [PATCH] fix(catfile): only close the process once The close func is called multiple times, which causes inconsistencies, mostly visible in incorrect metrics. Fixes: #6651 Signed-off-by: Thomas Way --- internal/git/catfile/cache.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/git/catfile/cache.go b/internal/git/catfile/cache.go index 0585f7a852e..8d0f999bdfd 100644 --- a/internal/git/catfile/cache.go +++ b/internal/git/catfile/cache.go @@ -330,7 +330,7 @@ func (c *ProcessCache) getOrCreateProcess( } } - return process, cancel, nil + return process, sync.OnceFunc(cancel), nil } func (c *ProcessCache) reportCacheMembers() { -- GitLab