From: Zygo Blaxell Date: Sun, 12 Jan 2025 20:17:21 +0000 (-0500) Subject: task: do not allow queue loops in priority queueing mode X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a819d623f75028b82d05315526fb34139d1b84f2;p=bees task: do not allow queue loops in priority queueing mode Tasks using non-priority FIFO dependency tracking can insert themselves into their own queue, to run the Task again immediately after it exits. For priority queues, this attempts to splice the post-exec queue into itself, which doesn't seem like a good idea. Signed-off-by: Zygo Blaxell --- diff --git a/lib/task.cc b/lib/task.cc index d0b58948..679a7141 100644 --- a/lib/task.cc +++ b/lib/task.cc @@ -328,6 +328,7 @@ namespace crucible { TaskState::insert(const TaskStatePtr &task) { THROW_CHECK0(invalid_argument, task); + THROW_CHECK2(invalid_argument, m_id, task->m_id, m_id != task->m_id); PairLock lock(m_mutex, task->m_mutex); if (!task->m_run_now) { task->m_run_now = true;