From 8fc7d6d162f4badde9210f2488bf9ec5eb6ea324 Mon Sep 17 00:00:00 2001 From: Matt Benjamin Date: Mon, 14 Feb 2022 18:26:22 -0500 Subject: [PATCH] rgwlc: permit disabling of (default) auto-clearing of stale sessions Provide an option to disable automatic clearing of stale sessions-- which, unless disabled, happens after 2 lifecycle scheduling cycles. The default behavior is most likely not desired when a debugging or testing lifecycle processing with rgw_lc_debug_interval is set, and therefore re-entering a running session after 2 scheduling cycles is fairly likely. Signed-off-by: Matt Benjamin --- src/common/options/rgw.yaml.in | 8 ++++++++ src/rgw/rgw_lc.cc | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/src/common/options/rgw.yaml.in b/src/common/options/rgw.yaml.in index 19d599f954c..ca5e2489198 100644 --- a/src/common/options/rgw.yaml.in +++ b/src/common/options/rgw.yaml.in @@ -3288,3 +3288,11 @@ options: - rgw flags: - startup +- name: rgwlc_auto_session_clear + type: bool + level: advanced + desc: Automatically clear stale lifecycle sessions (i.e., after 2 idle processing cycles) + default: true + services: + - rgw + with_legacy: true \ No newline at end of file diff --git a/src/rgw/rgw_lc.cc b/src/rgw/rgw_lc.cc index 4570689eea8..6ee6e8ae2f1 100644 --- a/src/rgw/rgw_lc.cc +++ b/src/rgw/rgw_lc.cc @@ -2005,6 +2005,10 @@ int RGWLC::process(LCWorker* worker, bool RGWLC::expired_session(time_t started) { + if (! cct->_conf->rgwlc_auto_session_clear) { + return false; + } + time_t interval = (cct->_conf->rgw_lc_debug_interval > 0) ? cct->_conf->rgw_lc_debug_interval : 24*60*60; -- 2.47.3