Skip to content

Commit

Permalink
Log removal from pool due to prereq being removed at INFO level
Browse files Browse the repository at this point in the history
  • Loading branch information
MetRonnie committed Nov 28, 2024
1 parent 3eb6fb0 commit a567000
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cylc/flow/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
3 changes: 3 additions & 0 deletions cylc/flow/task_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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}")

Expand Down
4 changes: 4 additions & 0 deletions tests/integration/test_remove.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit a567000

Please sign in to comment.