aboutsummaryrefslogtreecommitdiff
path: root/src/zenstore/gc.cpp
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2023-10-06 13:31:08 +0200
committerGitHub <[email protected]>2023-10-06 13:31:08 +0200
commit49428e56261ace28cdabee10e354d7a08850727c (patch)
tree2ed1ce1a3c086745d1dfead36b2052413fa6e9b7 /src/zenstore/gc.cpp
parentzenserver project restructuring (#442) (diff)
downloadzen-49428e56261ace28cdabee10e354d7a08850727c.tar.xz
zen-49428e56261ace28cdabee10e354d7a08850727c.zip
fix gc infinite loop (#453)
* make sure we update last gc time even if gc fails * If we can't check if an oplog/project markerfile exists, assume it is not expired
Diffstat (limited to 'src/zenstore/gc.cpp')
-rw-r--r--src/zenstore/gc.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/zenstore/gc.cpp b/src/zenstore/gc.cpp
index d86bfd0fa..ef8945d91 100644
--- a/src/zenstore/gc.cpp
+++ b/src/zenstore/gc.cpp
@@ -1046,15 +1046,23 @@ GcScheduler::SchedulerThread()
{
ZEN_ERROR("scheduling garbage collection failed with system error exception: '{}'", SystemError.what());
}
+ m_LastGcTime = GcClock::Now();
+ m_LastLightweightGcTime = m_LastGcTime;
+ WaitTime = m_Config.MonitorInterval;
}
catch (std::bad_alloc& BadAlloc)
{
ZEN_WARN("scheduling garbage collection ran out of memory: '{}'", BadAlloc.what());
+ m_LastGcTime = GcClock::Now();
+ m_LastLightweightGcTime = m_LastGcTime;
+ WaitTime = m_Config.MonitorInterval;
}
catch (std::exception& Ex)
{
ZEN_ERROR("scheduling garbage collection failed with: '{}'", Ex.what());
- WaitTime = m_Config.MonitorInterval;
+ m_LastGcTime = GcClock::Now();
+ m_LastLightweightGcTime = m_LastGcTime;
+ WaitTime = m_Config.MonitorInterval;
}
}
}