Skip to content
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

pool: warn when triggering queued tasks in different flows #6232

Closed
wants to merge 1 commit into from

Conversation

oliver-sanders
Copy link
Member

@oliver-sanders oliver-sanders commented Jul 15, 2024

  • The --flow argument is ignored if you trigger a queued task.
  • It would be possible, though tricky, to merge the flows at this point as queued tasks already have database entries.
  • Merging is the correct solution, but for now, this PR will log a warning to let the user know / leave some record that the trigger did not take effect (i.e. continue the status quo but explain what's happening).
  • Might be easier to come back to the merging problem post cylc-remove to see what requirement there is for recording the flow number before a task has run once that work is in.
  • Closes triggering a queued task in a different flow has no effect #6174

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 (v minor, unreported issue)
  • 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.3.3 milestone Jul 15, 2024
@oliver-sanders oliver-sanders self-assigned this Jul 15, 2024
* The `--flow` argument is ignored if you trigger a queued task.
* It would be possible, though tricky, to merge the flows at this point
  as queued tasks already have database entries.
* This PR will log a warning to let the user know / leave some record
  that the trigger did not take effect.
* Closes cylc#6174
@hjoliver
Copy link
Member

It would be possible, though tricky, to merge the flows at this point as queued tasks already have database entries.

I don't think it is tricky, unless I'm missing something. I'll put up another PR to possibly supersede this one...

Comment on lines 524 to 525
this behaviour at a later date, however, it is tricky as at present the
task's entry in the task_outputs table already exists by this point.
Copy link
Member

@hjoliver hjoliver Jul 17, 2024

Choose a reason for hiding this comment

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

OK this is why you thought it's tricky. Actually the same thing happens with any flow merge, since it only occurs if a flow runs into an existing n=0 task. We just add a new flow row in the DB:

$ sqlite3 ~/cylc-run/bug/runN/log/db "select * from task_outputs"
1|bar|[1]|{"submitted": "submitted", "started": "started"}
1|foo|[1]|{}                                                       # <--- pre merge, waiting
1|foo|[1, 2]|{"submitted": "submitted", "started": "started"}      # <--- post merge, running

Copy link
Member Author

Choose a reason for hiding this comment

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

Isn't it a problem leaving the [1] task behind in the DB?

Copy link
Member

Choose a reason for hiding this comment

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

How is it a problem?

On the plus side, you can see exactly what happened (flow merge when foo was waiting).

And, as I said, the same thing happens for normal (non manual trigger) flow merges.

@oliver-sanders
Copy link
Member Author

Superseded by #6241

@oliver-sanders oliver-sanders removed this from the 8.3.3 milestone Jul 18, 2024
@oliver-sanders oliver-sanders removed their assignment Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants