cylc / cylc-ui

Web app for monitoring and controlling Cylc workflows
https://cylc.github.io
GNU General Public License v3.0
37 stars 27 forks source link

Suicide triggers can cause arrows to permanently disappear from graph view #1787

Closed MetRonnie closed 6 months ago

MetRonnie commented 6 months ago

The arrows may disappear from the graph view, which I have tracked down to the layout() method: https://github.com/cylc/cylc-ui/blob/c151c9a8084e48cc07b664e0188c62665c675016/src/views/Graph.vue#L652-L659

where bbox is undefined.

Originally reported in #1470 but not fixed it seems.

This is accompanied by the console error message (in Chrome):

TypeError: Cannot read properties of undefined (reading 'width')

Reproducible example

[scheduler]
    allow implicit tasks = True
[scheduling]
    cycling mode = integer
    runahead limit = P0
    [[graph]]
        P1 = """
            forecast[-P1] => foo?
            foo? => !x1 & !x2 & !x3
            foo:fail? => x1
            x1 => x2 => x3
            x3 | bar => forecast
        """

image

It seems the suicide trigger edges in the workflow subscription are not pruned, leading to a mismatch between the nodes and edges that the Graph view is trying to plot. In fact the suicide trigger edges do not seem to be pruned at all and keep accumulating?

dwsutherland commented 6 months ago

Reproduced using; using

query {
  workflows (ids: ["edges/run1"]) {
    name
    stateTotals
    taskProxies{
      id
    }
    edges {
      edges {
        id
      }
    }
  }
}
{
  "data": {
    "workflows": [
      {
        "name": "edges/run1",
        "stateTotals": {
          "waiting": 8,
          "expired": 0,
          "preparing": 0,
          "submit-failed": 0,
          "submitted": 0,
          "running": 0,
          "failed": 0,
          "succeeded": 0
        },
        "taskProxies": [
          {
            "id": "~sutherlander/edges/run1//1/bar"
          },
          {
            "id": "~sutherlander/edges/run1//1/forecast"
          },
          {
            "id": "~sutherlander/edges/run1//2/bar"
          },
          {
            "id": "~sutherlander/edges/run1//2/forecast"
          },
          {
            "id": "~sutherlander/edges/run1//1/foo"
          },
          {
            "id": "~sutherlander/edges/run1//1/x2"
          },
          {
            "id": "~sutherlander/edges/run1//1/x1"
          },
          {
            "id": "~sutherlander/edges/run1//1/x3"
          }
        ],
        "edges": {
          "edges": [
            {
              "id": "~sutherlander/edges/run1//$edge|1/bar|1/forecast"
            },
            {
              "id": "~sutherlander/edges/run1//$edge|2/bar|2/forecast"
            },
            {
              "id": "~sutherlander/edges/run1//$edge|1/foo|1/x2"
            },
            {
              "id": "~sutherlander/edges/run1//$edge|1/foo|1/x1"
            },
            {
              "id": "~sutherlander/edges/run1//$edge|1/foo|1/x3"
            }
          ]
        }
      }
    ]
  }
}

but after running for a while:

{
  "data": {
    "workflows": [
      {
        "name": "edges/run1",
        "stateTotals": {
          "waiting": 4,
          "expired": 0,
          "preparing": 0,
          "submit-failed": 0,
          "submitted": 0,
          "running": 0,
          "failed": 0,
          "succeeded": 2
        },
        "taskProxies": [
          {
            "id": "~sutherlander/edges/run1//19/bar"
          },
          {
            "id": "~sutherlander/edges/run1//19/forecast"
          },
          {
            "id": "~sutherlander/edges/run1//19/x3"
          },
          {
            "id": "~sutherlander/edges/run1//20/bar"
          },
          {
            "id": "~sutherlander/edges/run1//20/forecast"
          },
          {
            "id": "~sutherlander/edges/run1//20/foo"
          }
        ],
        "edges": {
          "edges": [
            {
              "id": "~sutherlander/edges/run1//$edge|1/x1|1/x2"
            },
            {
              "id": "~sutherlander/edges/run1//$edge|2/x1|2/x2"
            },
            {
              "id": "~sutherlander/edges/run1//$edge|3/x1|3/x2"
            },
            {
              "id": "~sutherlander/edges/run1//$edge|4/x1|4/x2"
            },
            {
              "id": "~sutherlander/edges/run1//$edge|5/x1|5/x2"
            },
            {
              "id": "~sutherlander/edges/run1//$edge|6/x1|6/x2"
            },
            {
              "id": "~sutherlander/edges/run1//$edge|7/x1|7/x2"
            },
            {
              "id": "~sutherlander/edges/run1//$edge|8/x1|8/x2"
            },
            {
              "id": "~sutherlander/edges/run1//$edge|9/x1|9/x2"
            },
            {
              "id": "~sutherlander/edges/run1//$edge|10/x1|10/x2"
            },
            {
              "id": "~sutherlander/edges/run1//$edge|11/x1|11/x2"
            },
            {
              "id": "~sutherlander/edges/run1//$edge|12/x1|12/x2"
            },
            {
              "id": "~sutherlander/edges/run1//$edge|13/x1|13/x2"
            },
            {
              "id": "~sutherlander/edges/run1//$edge|14/x1|14/x2"
            },
            {
              "id": "~sutherlander/edges/run1//$edge|15/x1|15/x2"
            },
            {
              "id": "~sutherlander/edges/run1//$edge|16/x1|16/x2"
            },
            {
              "id": "~sutherlander/edges/run1//$edge|17/x1|17/x2"
            },
            {
              "id": "~sutherlander/edges/run1//$edge|19/bar|19/forecast"
            },
            {
              "id": "~sutherlander/edges/run1//$edge|18/x1|18/x2"
            },
            {
              "id": "~sutherlander/edges/run1//$edge|20/bar|20/forecast"
            },
            {
              "id": "~sutherlander/edges/run1//$edge|19/forecast|20/foo"
            },
            {
              "id": "~sutherlander/edges/run1//$edge|19/x3|19/forecast"
            },
            {
              "id": "~sutherlander/edges/run1//$edge|19/x2|19/x3"
            },
            {
              "id": "~sutherlander/edges/run1//$edge|19/x1|19/x2"
            }
          ]
        }
      }
    ]
  }
}

I'll look at the pruning mechanism.. For some reason it's always x1 -> x2 that doesn't get pruned .. never x2 -> x3

dwsutherland commented 6 months ago

Fix up https://github.com/cylc/cylc-flow/pull/6096

Some deltas we discard (if the nodes they apply to are about to be pruned), we needed to delete any associated edges too..

hjoliver commented 6 months ago

Closed by https://github.com/cylc/cylc-flow/pull/6096