Skip to content

Commit a567000

Browse files
committed
Log removal from pool due to prereq being removed at INFO level
1 parent 3eb6fb0 commit a567000

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

cylc/flow/scheduler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1140,7 +1140,7 @@ def remove_tasks(
11401140
):
11411141
continue
11421142
# No longer has reason to be in pool:
1143-
self.pool.remove(child_itask, 'prerequisite task(s) removed')
1143+
self.pool.remove(child_itask, self.pool.REMOVED_BY_PREREQ)
11441144
# Remove this downstream task from flows in DB tables to ensure
11451145
# it is not skipped if it respawns in future:
11461146
self.workflow_db_mgr.remove_task_from_flows(

cylc/flow/task_pool.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ class TaskPool:
121121
ERR_TMPL_NO_TASKID_MATCH = "No matching tasks found: {0}"
122122
ERR_PREFIX_TASK_NOT_ON_SEQUENCE = "Invalid cycle point for task: {0}, {1}"
123123
SUICIDE_MSG = "suicide trigger"
124+
REMOVED_BY_PREREQ = "prerequisite task(s) removed"
124125

125126
def __init__(
126127
self,
@@ -875,6 +876,8 @@ def remove(self, itask: 'TaskProxy', reason: Optional[str] = None) -> None:
875876
):
876877
level = logging.WARNING
877878
msg += " - active job orphaned"
879+
elif reason == self.REMOVED_BY_PREREQ:
880+
level = logging.INFO
878881

879882
LOG.log(level, f"[{itask}] {msg}")
880883

tests/integration/test_remove.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,10 @@ async def test_prereqs(
362362
# Should cause 1/x to be removed from the pool as it no longer has
363363
# any satisfied prerequisite tasks:
364364
assert not schd.pool._get_task_by_id('1/x')
365+
assert log_filter(
366+
logging.INFO,
367+
regex=r"1/x.* removed .* prerequisite task\(s\) removed",
368+
)
365369

366370

367371
async def test_downstream_preparing(flow, scheduler, start):

0 commit comments

Comments
 (0)