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

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

Closed
MetRonnie opened this issue May 7, 2024 · 3 comments · Fixed by cylc/cylc-flow#6096
Closed
Assignees
Labels
bug Something isn't working

Comments

@MetRonnie
Copy link
Member

MetRonnie commented May 7, 2024

The arrows may disappear from the graph view, which I have tracked down to the layout() method:

cylc-ui/src/views/Graph.vue

Lines 652 to 659 in c151c9a

const bbox = nodeDimensions[obj.name]
// translations:
// 1. The graphviz node coordinates
// 2. Centers the node on this coordinate
// TODO convert (2) to maths OR fix it to avoid recomputation?
this.nodeTransformations[obj.name] = `
translate(${x}, -${y})
translate(-${bbox.width / 2}, -${bbox.height / 2})

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?

@MetRonnie MetRonnie added the bug Something isn't working label May 7, 2024
@MetRonnie MetRonnie added this to the 2.6.0 milestone May 7, 2024
@MetRonnie MetRonnie self-assigned this May 7, 2024
@MetRonnie MetRonnie changed the title Arrows can disappear from graph view Suicide triggers can cause arrows to permanently disappear from graph view May 7, 2024
@MetRonnie MetRonnie removed their assignment May 7, 2024
@dwsutherland
Copy link
Member

dwsutherland commented May 9, 2024

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
Copy link
Member

Fix up cylc/cylc-flow#6096

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

@oliver-sanders oliver-sanders linked a pull request May 10, 2024 that will close this issue
8 tasks
@MetRonnie MetRonnie removed this from the 2.6.0 milestone May 10, 2024
@hjoliver
Copy link
Member

Closed by cylc/cylc-flow#6096

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants