From 9439dad93ae0773dfb0940bc9997231df6004c4d Mon Sep 17 00:00:00 2001 From: Zygo Blaxell Date: Mon, 17 Feb 2025 20:02:18 -0500 Subject: [PATCH] extent scan: extra check to make sure no Tasks are started when throttled Previously `scan()` would run the extent scan loop once, and enqueue one extent, before checking for throttling. Do an extra check before that, and bail out so that zero extents are enqueued when throttled. Signed-off-by: Zygo Blaxell --- src/bees-roots.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/bees-roots.cc b/src/bees-roots.cc index 52536ec..930ac02 100644 --- a/src/bees-roots.cc +++ b/src/bees-roots.cc @@ -899,6 +899,9 @@ BeesScanModeExtent::scan() { BEESTRACE("bsm scan"); + // Do nothing if we are throttled + if (should_throttle()) return; + unique_lock lock(m_mutex); const auto size_tiers_copy = m_size_tiers; lock.unlock();