diff options
Diffstat (limited to 'src/zenstore/gc.cpp')
| -rw-r--r-- | src/zenstore/gc.cpp | 78 |
1 files changed, 38 insertions, 40 deletions
diff --git a/src/zenstore/gc.cpp b/src/zenstore/gc.cpp index 050ee3443..61ac2ef69 100644 --- a/src/zenstore/gc.cpp +++ b/src/zenstore/gc.cpp @@ -2469,49 +2469,39 @@ GcScheduler::SchedulerThread() WaitTime = m_Config.MonitorInterval; continue; } - } - - 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"); - } - - m_GcManager.SetCancelGC(false); + if (!SkipCid) + { + m_AttachmentPassIndex = NextAttachmentPassIndex; + } - uint32_t RunningState = static_cast<uint32_t>(GcSchedulerStatus::kRunning); - if (!m_Status.compare_exchange_strong(RunningState, static_cast<uint32_t>(GcSchedulerStatus::kIdle))) - { - ZEN_ASSERT(m_Status == static_cast<uint32_t>(GcSchedulerStatus::kStopped)); - break; + 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) @@ -2548,6 +2538,14 @@ GcScheduler::SchedulerThread() m_LastLightweightGcTime = m_LastGcTime; WaitTime = m_Config.MonitorInterval; } + m_GcManager.SetCancelGC(false); + + uint32_t RunningState = static_cast<uint32_t>(GcSchedulerStatus::kRunning); + if (!m_Status.compare_exchange_strong(RunningState, static_cast<uint32_t>(GcSchedulerStatus::kIdle))) + { + ZEN_ASSERT(m_Status == static_cast<uint32_t>(GcSchedulerStatus::kStopped)); + break; + } } } |