Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cylc/flow/task_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -2440,6 +2440,7 @@ def clock_expire_tasks(self):
itask,
logging.WARNING,
TASK_OUTPUT_EXPIRED,
forced=True,
Copy link
Member Author

@oliver-sanders oliver-sanders Oct 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hjoliver, is this a valid use of the force argument?

Looks like the tutorial workflow tests failed as this change removed the (internal) prefix from the expired log message.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's valid, but maybe update the docstring in the message to say that expiry counts as forcing too.

Do we also need this for suicide-induced task expiry? (See line 1565)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The message currently reads:

forced:
If this message is due to manual completion or not (cylc set)

So, should this be:

If this message was set for internal (i.e, artificial) as opposed to natural satisfaction.

If so, are there any other situations we should be using this in?

)

def task_succeeded(self, id_):
Expand Down
20 changes: 15 additions & 5 deletions tests/integration/test_task_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
from cylc.flow.exceptions import WorkflowConfigError
from cylc.flow.flow_mgr import FLOW_NONE
from cylc.flow.id import TaskTokens, Tokens
from cylc.flow.run_modes import RunMode
from cylc.flow.task_events_mgr import TaskEventsManager
from cylc.flow.task_outputs import (
TASK_OUTPUT_FAILED,
Expand Down Expand Up @@ -2300,16 +2301,15 @@ async def test_expire_dequeue_with_retries(
conf = {
'scheduling': {
'initial cycle point': '2000',

'graph': {
'R1': 'foo'
},
},
'runtime': {
'foo': {
'execution retry delays': 'PT0S'
}
}
'execution retry delays': 'PT0S',
},
},
}

if expire_type == 'clock-expire':
Expand All @@ -2324,11 +2324,21 @@ async def test_expire_dequeue_with_retries(
)

id_ = flow(conf)
schd = scheduler(id_)
schd = scheduler(id_, run_mode='live')
schd: Scheduler
async with start(schd):
itask = schd.pool.get_tasks()[0]

# fake a real submission failure
# NOTE: yes, all of these things are needed for a valid test!
# Try removing the "force=True" added in this commit and ensure the
# "clock-expire" test fails before changing anything here!
itask.submit_num += 1
itask.run_mode = RunMode.LIVE
schd.task_job_mgr._set_retry_timers(itask, itask.tdef.rtconfig)
schd.task_events_mgr.process_message(itask, 0, 'failed')
schd.task_events_mgr._retry_task(itask, 0)

# the task should start as "waiting(queued)"
assert itask.state(TASK_STATUS_WAITING, is_queued=True)

Expand Down
Loading