]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw/d4n: fix for rgw user create hanging when vstart
authorPritha Srivastava <prsrivas@redhat.com>
Tue, 17 Jun 2025 06:07:16 +0000 (11:37 +0530)
committerPritha Srivastava <prsrivas@redhat.com>
Tue, 26 Aug 2025 04:18:05 +0000 (09:48 +0530)
cluster starts when there is data in cache.

the cleaning thread sleeps when the entry for cleaning
has not expired, therefore radosgw-admin user create hangs
when vstart cluster comes up.

Signed-off-by: Pritha Srivastava <prsrivas@redhat.com>
src/rgw/driver/d4n/d4n_policy.cc

index d2d9834c3f0786038b6aa35f573e3fbc4e523b36..523c58f83729f617a8123280793bf2bc86255b59 100644 (file)
@@ -973,7 +973,11 @@ void LFUDAPolicy::cleaning(const DoutPrefixProvider* dpp)
        erase_dirty_object(dpp, e->key, null_yield);
       }
     } else if (diff < interval) { //end-if std::difftime(time(NULL), e->creationTime) > interval
-      std::this_thread::sleep_for(std::chrono::seconds(interval - diff));
+      {
+        std::unique_lock<std::mutex> wait_lock(lfuda_cleaning_lock);
+        cond.wait_for(wait_lock, std::chrono::seconds(interval - diff), []{ return quit.load(); });
+      }
+      continue;
     }
   } //end-while true
 }