From a819d623f75028b82d05315526fb34139d1b84f2 Mon Sep 17 00:00:00 2001 From: Zygo Blaxell Date: Sun, 12 Jan 2025 15:17:21 -0500 Subject: [PATCH] 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 --- lib/task.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/task.cc b/lib/task.cc index d0b5894..679a714 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;