From 1f5357ba45b23f93b3e201afa67d5962c290ab7f Mon Sep 17 00:00:00 2001 From: quobix Date: Tue, 12 Dec 2023 13:25:26 -0500 Subject: [PATCH] Fixed deadlock causing 100% CPU spike MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I have seen this issue appear online a few times, the CPU locks at 100% when throwing a bad reference. This happened because the local ‘lock’ used by the rolodex file loader, was not releasing correctly when a lookup occurred, that could not be found via a rolodex file lookup. https://github.com/daveshanley/vacuum/issues/393 Signed-off-by: quobix --- index/rolodex_file_loader.go | 1 + 1 file changed, 1 insertion(+) diff --git a/index/rolodex_file_loader.go b/index/rolodex_file_loader.go index e6321dc..94f8f05 100644 --- a/index/rolodex_file_loader.go +++ b/index/rolodex_file_loader.go @@ -152,6 +152,7 @@ func (l *LocalFS) Open(name string) (fs.File, error) { } } } + l.processingFiles.Delete(name) return nil, &fs.PathError{Op: "open", Path: name, Err: fs.ErrNotExist} }