Skip to content

Conversation

@hjoliver
Copy link
Member

@hjoliver hjoliver commented Oct 21, 2025

Close #7037

If auto-spawned parentless tasks are present at shutdown, on restart they will be resurrected from the DB; and auto-spawned to the runahead limit again - because we don't record whether or not parentless tasks were spawned already.

This double-spawning is prevented (by luck - [see footnote]) by the imperfect bodge that stops suicided tasks from being resurrected by other dependencies - which has no functional effect, but it results in misleading log messages.

Said imperfect bodge was fixed by re-implementing suicide triggers as expire triggers (#6835) - but for now that's experimental.

Solution implemented here:

  • if the experimental expire trigger feature is turned on on:
  • if the expire trigger feature is not turned on:
    • do run the bodge (it's still needed for suicide triggers, despite being imperfect)
    • but demote the log message to DEBUG and change it slightly to work for both cases (suicide and parentless)

[footnote] - if the double-spawning had not been prevented by the bodge I think the new instance would just replace the old in the task pool, which would actually be fine because the task had not done anything yet (however, better not to do it).

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.

@hjoliver hjoliver added this to the 8.6.1 milestone Oct 21, 2025
@hjoliver hjoliver requested a review from MetRonnie October 21, 2025 03:31
@hjoliver hjoliver self-assigned this Oct 21, 2025
@hjoliver hjoliver added the bug Something is wrong :( label Oct 21, 2025
@hjoliver hjoliver changed the base branch from master to 8.6.x October 21, 2025 03:37
self.active_tasks[itask.point][itask.identity] = itask
self.active_tasks_changed = True
LOG.debug(f"[{itask}] added to the n=0 window")
LOG.info(f"[{itask}] added to the n=0 window")
Copy link
Member Author

Choose a reason for hiding this comment

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

Deliberate change - it's important for users to know when tasks enter the n=0 window (otherwise it only gets logged as INFO at the first state change).

Copy link
Member

Choose a reason for hiding this comment

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

I don't see why this is useful info to have in the logs

Comment on lines +2586 to +2594
id_ = flow(
{
'scheduling': {
'graph': {
'R1': 'a',
},
},
}
)
Copy link
Member

Choose a reason for hiding this comment

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

Can make this shorter

Suggested change
id_ = flow(
{
'scheduling': {
'graph': {
'R1': 'a',
},
},
}
)
id_ = flow('a')

self.active_tasks[itask.point][itask.identity] = itask
self.active_tasks_changed = True
LOG.debug(f"[{itask}] added to the n=0 window")
LOG.info(f"[{itask}] added to the n=0 window")
Copy link
Member

Choose a reason for hiding this comment

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

I don't see why this is useful info to have in the logs

Copy link
Member

@MetRonnie MetRonnie left a comment

Choose a reason for hiding this comment

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

To me it looks like the problem is that we keep calling pool.release_runahead_tasks() every time we load a single task from the DB instead of just calling it at the end of loading all tasks.

Had a go at this here (unavoidable refactoring): https://github.com/cylc/cylc-flow/compare/master...MetRonnie:runahead-release?expand=1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something is wrong :(

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Spurious "Not respawning... task was removed" log messages

2 participants