Open ColemanTom opened 1 month ago
This is intended.
The held attribute should not make any difference here, because we can run held tasks (they should stay held to prevent any automatic retries unless released).
Are you happy with this explanation, @ColemanTom ?
Ah, ok. So because this task is in a queue, it takes two triggers. I just tested on a task that does not belong to a queue and it does only take one. I think that there is no visible change in the WUI when I do the first trigger is part of the confusion. In Cylc7, when triggering a task which was in a full queue, it changed to (I think) a yellow colour so show the state had changed. Here, there was no update to the display.
In Cylc 8 "queued" isn't a task state, it's a particular attribute of the waiting state.
Task attributes are shown as badges on the task icon. I think we only display one badge at a time, and we prioritize held over queued, so that's why you didn't see a change in the GUI.
@cylc/core - maybe this suggests we need to stack multiple badges on task icons?
It would be helpful to see some indication that an action has been registered and done something. I wasn't sure if it was severe lag or what was happening.
(We can close this after adding or tweaking a cylc-ui issue to cover the last comment)
[edit]: Dammit, this is wrong, see later comment
Aah right.
Under normal circumstances, triggering a held task DOES cause it to be run immediately, however, in this case the queue that the task was added to was full so it sat there waiting.
(We can close this after adding or tweaking a cylc-ui issue to cover the last comment)
If the queued state always beats the held state (which I think it does), then we can resolve this by changing the "task modifier" icon order from:
to:
Note, this applies both to the GUI and Tui.
Additionally, when you select a task in either, you should get a task state summary (e.g. waiting (held)
). We should ensure that queued beats held here too.
And (although I agree that held isn't really a special case here) we should still give it a passing mention in the docs:
$ cylc trigger --help | grep held
TODO:
cylc trigger
CLI help?cylc trigger
GraphQL schema?As an aside, see this snippet from the Cylc UI design document where we were exploring context information for task state modifiers:
And the [now?] erroneous statement underneath about held taking priority over queue (I guess that made sense at the time?).
Where the "view" button would have taken you to this https://github.com/cylc/cylc-ui/issues/462
@hjoliver
Sorry, on reflection, I have realised that this was not the intended behaviour and is actually inconsistent. The current behaviour is an unintended result of a bugfix (mia-culpa) for a completely different issue.
To explain, here's the stated intention:
- Triggering an unqueued waiting task queues it, regardless of prerequisites.
- Triggering a queued task submits it, regardless of queue limiting.
- Triggering an active task has no effect (it already triggered).
cylc trigger --help
Under this logic, if you trigger a held task it will be queued. If there is space in the queue, it will run instantly.
However, at a later date, the queues because "is_held" aware in order to allow users to hold queued tasks (without us having to yank the tasks out of the queue in order to do so):
So a held task won't queue (naturally) and a queued held task won't run (naturally).
This changed the behaviour. Now when we trigger a held task, it gets added to the queue, but the queue will never release it (irrespective of whether there is space in the queue or not).
So the behaviour changed from "it will run when there is space in the queue" to "it will never run under any circumstances" which was not intended. Intentions aside, the "it will never run" bit is also totally illogical.
In my above comment, I made this suggestion:
If the queued state always beats the held state (which I think it does), then we can resolve this by changing the "task modifier" icon order from:
- is_held
- is_queued
- is_runahead
to:
- is_queued
- is_held
- is_runahead
However, that doesn't make sense. Under the current implementation:
So there is no order of precedence we can give the task modifier icon that will work in all cases, in other words, the logic is inconsistent.
To resolve this we need to either:
Option (2) is nicer, and technically correct (if you hold a queued task, you are suppressing it from being submitted, so it doesn't make sense for the task to remain queued). I think it's relatively easy to do these days as we now have other functionality that needs to remove tasks from the queue (e.g. cylc remove
).
I ran into a hold bug when testing this on Friday, which I'll now try to reproduce (from memory ... it was on my office box, and I'm WFH today). However, I thought it was a different issue, because @ColemanTom's description above says:
If I read that correctly, the trigger pushes it to the queued state, and then a second trigger pushes to submit the job. I had expected that triggering would shift it twice.
That's just the intended double-trigger behaviour when queue-limiting is active, which doesn't seem to gel with what you're saying @oliver-sanders ... maybe it depends on how Tom's tasks got held in the first place (e.g. were they already queued or not?).
(Side-issue spawned after taking hold and queue out of the mix: #6406 )
Tom's tasks got held in the first place (e.g. were they already queued or not?).
I don't really remember the setup I had. If I pay attention and see it again I'll try to comment back here.
Talking a step back from attribute priority, to confirm triggering and queues work as intended without hold involved:
[scheduling]
[[queues]]
[[[default]]]
limit = 1
[[graph]]
R1 = "foo:start => a => b"
[runtime]
[[foo]]
pre-script = "sleep 360"
[[a, b]]
script = "sleep 10; false"
execution retry delays = PT5S
foo:start
spawns a
as queued; b
remains a future taska (queued)
once runs itb
once queues it; twice runs itjob 02:
a
queues again after retry time is done; triggering once runs itb
returns to waiting on a:succeeded
after retry timer is done; triggering once queues it, twice runs it All good ✔️ (but see #6406)
Now see how hold affects the active (n=0) waiting task a
:
a:waiting(queued) => a:waiting(held)(queued)
=> a:waiting(held)
(not queued) => waiting(queued)
This kinda seems right from a manual triggering perspective, IF we think that manually triggering a held task should make it and remain held - which seems reasonable because we can hold a running task, which just means it won't automatically retry.
But maybe not from an automatic triggering perspective, because a held task cannot submit a job automatically, so arguably it should not be queued? 🤔
Now see how hold affects the future task b
:
=> waiting(queued)
- (the hold list is not used?)Alternatively:
cylc set -p 1/a
causes it to spawn naturally => waiting(held)
- or trigger a
and allow it to succeed - (the hold list is used)=> b:waiting(held)(queued)
(Then same as for the a
case above)
I am finding that if I have a held workflow (not paused), if I trigger a task it appears to do nothing. But, if I trigger it twice, it will then run the task. See the attached gif.
The scheduler log shows this
If I read that correctly, the trigger pushes it to the
queued
state, and then a second trigger pushes to submit the job. I had expected that triggering would shift it twice.I'm unsure if this is a Cylc-flow question or a UI question, so I've put it here as that is how I'm looking at it.