From 3d536ea6dfeb8c26171d0dff9b8ff2a34f509788 Mon Sep 17 00:00:00 2001 From: Zygo Blaxell Date: Sun, 15 Jul 2018 16:54:25 -0400 Subject: [PATCH] roots: if queue is full run again The task queue may already be full of tasks when the crawl task is executed. In this case simply reschedule the crawl task at the end of the current queue. Signed-off-by: Zygo Blaxell --- src/bees-roots.cc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/bees-roots.cc b/src/bees-roots.cc index 65ba8fc..6e81968 100644 --- a/src/bees-roots.cc +++ b/src/bees-roots.cc @@ -380,13 +380,10 @@ BeesRoots::crawl_thread() m_crawl_task = Task("crawl_master", [shared_this]() { auto tqs = TaskMaster::get_queue_count(); BEESNOTE("queueing extents to scan, " << tqs << " of " << BEES_MAX_QUEUE_SIZE); - bool run_again = false; - while (tqs < BEES_MAX_QUEUE_SIZE) { + bool run_again = true; + while (tqs < BEES_MAX_QUEUE_SIZE && run_again) { run_again = shared_this->crawl_roots(); tqs = TaskMaster::get_queue_count(); - if (!run_again) { - break; - } } if (run_again) { shared_this->m_crawl_task.run();