From 1cc6a5cbd09f593df855f4602228546b8edf67ee Mon Sep 17 00:00:00 2001 From: Dan Engelbrecht Date: Wed, 22 Oct 2025 22:55:24 +0200 Subject: remove scope in GC that prevented GC from executing (#600) --- src/zenstore/gc.cpp | 61 +++++++++++++++++++++++++++-------------------------- 1 file changed, 31 insertions(+), 30 deletions(-) (limited to 'src') diff --git a/src/zenstore/gc.cpp b/src/zenstore/gc.cpp index 61ac2ef69..3fc795f9e 100644 --- a/src/zenstore/gc.cpp +++ b/src/zenstore/gc.cpp @@ -2469,39 +2469,40 @@ GcScheduler::SchedulerThread() WaitTime = m_Config.MonitorInterval; continue; } + } - if (!SkipCid) - { - m_AttachmentPassIndex = NextAttachmentPassIndex; - } + if (!SkipCid) + { + m_AttachmentPassIndex = NextAttachmentPassIndex; + } - bool GcSuccess = CollectGarbage(CacheExpireTime, - ProjectStoreExpireTime, - BuildStoreExpireTime, - DoDelete, - CollectSmallObjects, - SkipCid, - UseGCVersion, - CompactBlockUsageThresholdPercent, - Verbose, - SingleThreaded, - AttachmentRangeMin, - AttachmentRangeMax, - StoreCacheAttachmentMetaData, - StoreProjectAttachmentMetaData, - EnableValidation, - SilenceErrors); - if (!GcSuccess) - { - SilenceErrors = true; - ZEN_INFO("gc going into error state - gc errors will be demoted to warnings until we recover"); - } - else if (SilenceErrors) - { - SilenceErrors = false; - ZEN_INFO("gc recovered from error state - gc errors will be will be reported as errors again"); - } + bool GcSuccess = CollectGarbage(CacheExpireTime, + ProjectStoreExpireTime, + BuildStoreExpireTime, + DoDelete, + CollectSmallObjects, + SkipCid, + UseGCVersion, + CompactBlockUsageThresholdPercent, + Verbose, + SingleThreaded, + AttachmentRangeMin, + AttachmentRangeMax, + StoreCacheAttachmentMetaData, + StoreProjectAttachmentMetaData, + EnableValidation, + SilenceErrors); + if (!GcSuccess) + { + SilenceErrors = true; + ZEN_INFO("gc going into error state - gc errors will be demoted to warnings until we recover"); } + else if (SilenceErrors) + { + SilenceErrors = false; + ZEN_INFO("gc recovered from error state - gc errors will be will be reported as errors again"); + } + WaitTime = std::chrono::seconds(0); } catch (const std::system_error& SystemError) -- cgit v1.2.3