From c407e41ef183eaaa953e883d5bbae3af4c943d89 Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Tue, 29 Nov 2016 16:44:29 -0800 Subject: [PATCH] rgw: set duration for lifecycle lease Fixes: http://tracker.ceph.com/issues/17965 Signed-off-by: Yehuda Sadeh --- src/rgw/rgw_lc.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/rgw/rgw_lc.cc b/src/rgw/rgw_lc.cc index 772e1e773462..5b07c5990af8 100644 --- a/src/rgw/rgw_lc.cc +++ b/src/rgw/rgw_lc.cc @@ -342,8 +342,12 @@ int RGWLC::bucket_lc_process(string& shard_id) int RGWLC::bucket_lc_post(int index, int max_lock_sec, cls_rgw_lc_obj_head& head, pair& entry, int& result) { + utime_t lock_duration(cct->_conf->rgw_lc_lock_max_time, 0); + rados::cls::lock::Lock l(lc_index_lock_name); l.set_cookie(cookie); + l.set_duration(lock_duration); + do { int ret = l.lock_exclusive(&store->lc_pool_ctx, obj_names[index]); if (ret == -EBUSY) { /* already locked by another lc processor */ -- 2.47.3