From a567000e3bb46ab2706343b23c3a8cf1d83e47e9 Mon Sep 17 00:00:00 2001 From: Ronnie Dutta <61982285+MetRonnie@users.noreply.github.com> Date: Thu, 28 Nov 2024 14:51:05 +0000 Subject: [PATCH] Log removal from pool due to prereq being removed at INFO level --- cylc/flow/scheduler.py | 2 +- cylc/flow/task_pool.py | 3 +++ tests/integration/test_remove.py | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/cylc/flow/scheduler.py b/cylc/flow/scheduler.py index 4a567bf4a4..32407d5c70 100644 --- a/cylc/flow/scheduler.py +++ b/cylc/flow/scheduler.py @@ -1140,7 +1140,7 @@ def remove_tasks( ): continue # No longer has reason to be in pool: - self.pool.remove(child_itask, 'prerequisite task(s) removed') + self.pool.remove(child_itask, self.pool.REMOVED_BY_PREREQ) # Remove this downstream task from flows in DB tables to ensure # it is not skipped if it respawns in future: self.workflow_db_mgr.remove_task_from_flows( diff --git a/cylc/flow/task_pool.py b/cylc/flow/task_pool.py index 284f1f8e03..3b1990169f 100644 --- a/cylc/flow/task_pool.py +++ b/cylc/flow/task_pool.py @@ -121,6 +121,7 @@ class TaskPool: ERR_TMPL_NO_TASKID_MATCH = "No matching tasks found: {0}" ERR_PREFIX_TASK_NOT_ON_SEQUENCE = "Invalid cycle point for task: {0}, {1}" SUICIDE_MSG = "suicide trigger" + REMOVED_BY_PREREQ = "prerequisite task(s) removed" def __init__( self, @@ -875,6 +876,8 @@ def remove(self, itask: 'TaskProxy', reason: Optional[str] = None) -> None: ): level = logging.WARNING msg += " - active job orphaned" + elif reason == self.REMOVED_BY_PREREQ: + level = logging.INFO LOG.log(level, f"[{itask}] {msg}") diff --git a/tests/integration/test_remove.py b/tests/integration/test_remove.py index 5ea0bc6376..aab060a788 100644 --- a/tests/integration/test_remove.py +++ b/tests/integration/test_remove.py @@ -362,6 +362,10 @@ async def test_prereqs( # Should cause 1/x to be removed from the pool as it no longer has # any satisfied prerequisite tasks: assert not schd.pool._get_task_by_id('1/x') + assert log_filter( + logging.INFO, + regex=r"1/x.* removed .* prerequisite task\(s\) removed", + ) async def test_downstream_preparing(flow, scheduler, start):