-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
expiry: prevent expired tasks from retrying automatically #6353
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Prevent clock-expired tasks from being automatically retried. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2150,3 +2150,51 @@ async def test_trigger_unqueued(flow, scheduler, start): | |
assert not schd.pool.task_queue_mgr.force_released, ( | ||
"Triggering an unqueued task should not affect the force_released list" | ||
) | ||
|
||
|
||
@pytest.mark.parametrize('expire_type', ['clock-expire', 'manual']) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Manual expiry wasn't broken, but I included it in this test for completeness. |
||
async def test_expire_dequeue_with_retries(flow, scheduler, start, expire_type): | ||
"""An expired waiting task should be removed from any queues. | ||
|
||
See https://github.com/cylc/cylc-flow/issues/6284 | ||
""" | ||
conf = { | ||
'scheduling': { | ||
'initial cycle point': '2000', | ||
|
||
'graph': { | ||
'R1': 'foo' | ||
}, | ||
}, | ||
'runtime': { | ||
'foo': { | ||
'execution retry delays': 'PT0S' | ||
} | ||
} | ||
} | ||
|
||
if expire_type == 'clock-expire': | ||
conf['scheduling']['special tasks'] = {'clock-expire': 'foo(PT0S)'} | ||
method = lambda schd: schd.pool.clock_expire_tasks() | ||
else: | ||
method = lambda schd: schd.pool.set_prereqs_and_outputs( | ||
['2000/foo'], prereqs=[], outputs=['expired'], flow=['1'] | ||
) | ||
|
||
id_ = flow(conf) | ||
schd = scheduler(id_) | ||
schd: Scheduler | ||
async with start(schd): | ||
itask = schd.pool.get_tasks()[0] | ||
|
||
# the task should start as "waiting(queued)" | ||
assert itask.state(TASK_STATUS_WAITING, is_queued=True) | ||
|
||
# expire the task via whichever method we are testing | ||
method(schd) | ||
|
||
# the task should enter the "expired" state | ||
assert itask.state(TASK_STATUS_EXPIRED, is_queued=False) | ||
|
||
# the task should also have been removed from the queue | ||
assert not schd.pool.task_queue_mgr.remove_task(itask) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Damn, love an easy fix!