diff options
| author | Dan Engelbrecht <[email protected]> | 2023-10-06 13:31:08 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-10-06 13:31:08 +0200 |
| commit | 49428e56261ace28cdabee10e354d7a08850727c (patch) | |
| tree | 2ed1ce1a3c086745d1dfead36b2052413fa6e9b7 /src/zenstore/gc.cpp | |
| parent | zenserver project restructuring (#442) (diff) | |
| download | zen-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.cpp | 10 |
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; } } } |