| 1 |
[scheduler] |
| 2 |
[[events]] |
| 3 |
inactivity timeout = PT1M |
| 4 |
expected task failures = "1/a" |
| 5 |
|
| 6 |
[scheduling] |
| 7 |
[[graph]] |
| 8 |
R1 = a |
| 9 |
|
| 10 |
[runtime] |
| 11 |
[[a]] |
| 12 |
script = """ |
| 13 |
if [[ $CYLC_TASK_SUBMIT_NUMBER == 1 ]]; then |
| 14 |
# wait for the scheduler to receive the started message, |
| 15 |
# then kill the job |
| 16 |
cylc__job__poll_grep_workflow_log -E '1/a.*running' |
| 17 |
cylc kill "${CYLC_WORKFLOW_ID}//1/a" |
| 18 |
# do not succeed immediately after issuing the kill command or the |
| 19 |
# workflow may shut down as complete before registering task failure |
| 20 |
# (This polling grep will never complete, but you know what I mean.) |
| 21 |
cylc__job__poll_grep_workflow_log -E '1/a.*failed' |
| 22 |
fi |
| 23 |
""" |
| 24 |
[[[events]]] |
| 25 |
# when the scheduler receives the failed message, trigger the task |
| 26 |
# to run again, it should run instantly |
| 27 |
failed handlers = cylc trigger "%(workflow)s//1/a" |