]> git.hungrycats.org Git - bees/commitdiff
extent scan: extra check to make sure no Tasks are started when throttled
authorZygo Blaxell <bees@furryterror.org>
Tue, 18 Feb 2025 01:02:18 +0000 (20:02 -0500)
committerZygo Blaxell <bees@furryterror.org>
Thu, 19 Jun 2025 01:17:48 +0000 (21:17 -0400)
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 <bees@furryterror.org>
src/bees-roots.cc

index 52536ec983553445e84da2bfbf20a94d395a7604..930ac0233c47f1acb2b3d4c1ca63a427d9c65825 100644 (file)
@@ -899,6 +899,9 @@ BeesScanModeExtent::scan()
 {
        BEESTRACE("bsm scan");
 
+       // Do nothing if we are throttled
+       if (should_throttle()) return;
+
        unique_lock<mutex> lock(m_mutex);
        const auto size_tiers_copy = m_size_tiers;
        lock.unlock();