Skip to content

restart timeout: fire event for stop after cycle point scenarios#6903

Merged
hjoliver merged 2 commits intocylc:8.5.xfrom
oliver-sanders:restart-timeout++
Aug 26, 2025
Merged

restart timeout: fire event for stop after cycle point scenarios#6903
hjoliver merged 2 commits intocylc:8.5.xfrom
oliver-sanders:restart-timeout++

Conversation

@oliver-sanders
Copy link
Copy Markdown
Member

@oliver-sanders oliver-sanders commented Aug 6, 2025

  • If a workflow hits the final cycle point and is restarted, it is considered complete.
  • If a restart timeout is configured, the scheduler will stay up for a configured period.
  • However, if a workflow hits the stop after after cycle point and is restarted, the restart timeout event is not yielded and the scheduler will instantly shut down again.

This has been reported as a problem for people following this design pattern: https://cylc.github.io/cylc-doc/stable/html/user-guide/examples/extending-workflow/index.html

Check List

  • I have read CONTRIBUTING.md and added my name as a Code Contributor.
  • Contains logically grouped changes (else tidy your branch by rebase).
  • Does not contain off-topic changes (use other PRs for other changes).
  • Applied any dependency changes to both setup.cfg (and conda-environment.yml if present).
  • Tests are included (or explain why tests are not needed).
  • Changelog entry included if this is a change that can affect users
  • Cylc-Doc pull request opened if required at cylc/cylc-doc/pull/XXXX.
  • If this is a bug fix, PR should be raised against the relevant ?.?.x branch.

@oliver-sanders oliver-sanders added this to the 8.5.1 milestone Aug 6, 2025
@oliver-sanders oliver-sanders self-assigned this Aug 6, 2025
@oliver-sanders oliver-sanders added the bug Something is wrong :( label Aug 6, 2025
@oliver-sanders oliver-sanders force-pushed the restart-timeout++ branch 2 times, most recently from 0b96bfc to aedd419 Compare August 6, 2025 16:47
@oliver-sanders oliver-sanders requested a review from hjoliver August 6, 2025 16:47
assert schd2.get_events() == {'startup', 'restart timeout', 'shutdown'}


async def test_restart_timeout_workflow_stop_after_cycle_point(
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Copy of above test, shimmed to test stop after cycle point.

* If a workflow hits the `final cycle point` and is restarted, it is
  considered complete.
* If a `restart timeout` is configured, the scheduler will stay up for a
  configured period.
* However, if a workflow hits the `stop after after cycle point` and is
  restarted, the `restart timeout` event is not yielded and the
  scheduler will instantly shut down again.
Copy link
Copy Markdown
Member

@hjoliver hjoliver left a comment

Choose a reason for hiding this comment

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

👍

@oliver-sanders oliver-sanders requested a review from wxtim August 11, 2025 10:05
@oliver-sanders oliver-sanders modified the milestones: 8.5.1, 8.5.2 Aug 11, 2025
if self.is_restart and (
# workflow has completed
not self.pool.get_tasks()
# workflow has hit the "stop after cycle point"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggest that this should be documented in globalcfg.py since this setting now applies to stopped as well as completed workflows.

Copy link
Copy Markdown
Member Author

@oliver-sanders oliver-sanders Aug 18, 2025

Choose a reason for hiding this comment

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

Done in 8e3afc7

@oliver-sanders oliver-sanders requested a review from wxtim August 18, 2025 10:35
@hjoliver hjoliver merged commit f9886d9 into cylc:8.5.x Aug 26, 2025
28 checks passed
@oliver-sanders oliver-sanders deleted the restart-timeout++ branch August 27, 2025 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something is wrong :( small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants