cylc / cylc-flow

Cylc: a workflow engine for cycling systems.
https://cylc.github.io
GNU General Public License v3.0
325 stars 90 forks source link

Data store: flow numbers reported do not update to match reality #6114

Open MetRonnie opened 1 month ago

MetRonnie commented 1 month ago

Description

Once a task is added to the data store with particular flow numbers, these do not update when the task actually runs with different flow numbers

Reproducible Example

[scheduler]
    allow implicit tasks = True
    [[events]]
        startup handlers = cylc trigger %(workflow)s//2/a --flow=2 && cylc hold %(workflow)s//2/a
[scheduling]
    cycling mode = integer
    runahead limit = P0
    [[graph]]
        P1 = c[-P1] => a => b => c
[runtime]
    [[root]]
        script = sleep 5
cylc play <workflow-id> --pause

Using my branch to display flow nums in the UI tree view:

demo16

(Greyed out flow numbers are for "ghost tasks" that are not yet in the pool)

Expected Behaviour

1/c should be reported as flows=1 when it starts running. It is instead reported as flows=2 because the ghost task created by the data store was based off 2/a which was triggered in flow 2.

2/a should be reported as flows=1,2 when released, as flow merge has occurred from flow 1 catching up with flow 2. It instead continues to be reported as flow 2.

MetRonnie commented 1 month ago

I have a branch (see https://github.com/cylc/cylc-flow/commit/f8cf9bfb76ccc282c02b16c6f50896f0b5b5652e) that attempts to fix this, however the fix results in traceback causing functional tests to fail which I don't understand.

E.g. tests/f/spawn-on-demand/06-stop-flow-2.t