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

Bug in suicide trigger handling #4333

Closed
hjoliver opened this issue Jul 29, 2021 · 2 comments
Closed

Bug in suicide trigger handling #4333

hjoliver opened this issue Jul 29, 2021 · 2 comments
Assignees
Labels
Milestone

Comments

@hjoliver
Copy link
Member

hjoliver commented Jul 29, 2021

See #4324 (comment)

Consider this Cylc 7 graph:

[scheduling]
  [[graph]]
      R1 = """
a1 => b1
a1:fail | b1 => c => d1
a1:fail & c => !a1 & !b1 & !d1
a2 => b2
a2:fail | b2 => c => d2
a2:fail & c => !a2 & !b2 & !d2
"""
[runtime]
  [[root]]
     script = sleep 5
  [[a1, b1, d1]]
  [[a2, b2, d2]]
  [[c]]
  [[a2]]
     script = false

(Example first noted here: cylc/cylc-admin#129 (comment))

With a2 failing, sometimes d1 runs, sometimes it doesn't. In the latter case we get spawn-time warnings of invalid cycle point (out of sequence bounds) for d1 (and sometimes d2).

@hjoliver hjoliver added the bug Something is wrong :( label Jul 29, 2021
@hjoliver hjoliver added this to the cylc-8.0b3 milestone Jul 29, 2021
@hjoliver hjoliver self-assigned this Jul 29, 2021
@hjoliver
Copy link
Member Author

hjoliver commented Jul 29, 2021

Phew, easy fix. The problem is the graph says both c => d1 and c => !d1. So this simple graph exhibits the same behaviour:

R1 = """
   c => d1
   c => !d1
"""

The result depends on which trigger the graph parser gets to first, because trigger can be normal or suicide, not both. Arguably the graph is invalid, but the full workflow above is trying to work around a graph parsing deficiency (see
cylc/cylc-admin#129 (comment)) so there might not be an alternative until we have dynamic subgraphs (Cylc 9). Ensuring that suicide triggers take precedence should fix the problem, if the parser encounters both for the same dependency.

@hjoliver
Copy link
Member Author

Arguably the graph is invalid,

God damn it. It is invalid. And in fact the error results from a mistranslation (by me) of the original example, and is not necessary for the aforementioned workaround.

I'll just make it fail validation instead.

(a => b and a => !b looks like how suicide triggers actually work in Cylc 8 - they spawn the target task if it hasn't been spawned already, in case it has multiple suicide triggers ... but not surprisingly trying to support this in the syntax results in nasty problems ... and it isn't necessary anyway).

@hjoliver hjoliver added invalid and removed bug Something is wrong :( labels Jul 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant