From 1d45fef353091bdf00d2b9255cb52d6433cd6928 Mon Sep 17 00:00:00 2001 From: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com> Date: Thu, 17 Sep 2026 15:38:05 +0100 Subject: [PATCH] refactor: drop the lock-hold logging from forEachKeyPartition The walk needs no diagnostics of its own. Timing the copy and warning above a threshold added a second concern to a method whose whole job is to hold the mutex briefly, and the log call itself took the sink's mutex. --- include/xrpl/basics/TaggedCache.ipp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/include/xrpl/basics/TaggedCache.ipp b/include/xrpl/basics/TaggedCache.ipp index 5f15e74794..dbe4a5874a 100644 --- a/include/xrpl/basics/TaggedCache.ipp +++ b/include/xrpl/basics/TaggedCache.ipp @@ -604,6 +604,8 @@ TaggedCache keys; + // partitions() and map() are fixed at construction, so the bound and the + // indexing need no lock. for (std::size_t p = 0; p < cache_.partitions(); ++p) { keys.clear(); @@ -611,17 +613,8 @@ TaggedCache= std::chrono::seconds{1}) - { - JLOG(journal_.warn()) - << name_ << " TaggedCache forEachKeyPartition held the lock " - << std::chrono::duration_cast(held).count() - << "ms over " << keys.size() << " entries"; - } } if (!f(keys)) return false;