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 takes precedence in otherwise identical triggers. #4334

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions cylc/flow/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -1516,9 +1516,6 @@ def generate_taskdefs(self, orig_expr, left_nodes, right, seq, suicide):
# Only add sequence to taskdef if explicit (not an offset).
if offset:
taskdef.used_in_offset_trigger = True
elif suicide and name == right:
# "foo => !bar" should not create taskdef bar
pass
Comment on lines -1519 to -1521
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment incorrect. We still need to know the valid sequences of a suicided task, in case it isn't spawned by any non-suicide triggers (as is the case in the example that triggers the bug).

else:
taskdef.add_sequence(seq)

Expand Down
8 changes: 8 additions & 0 deletions cylc/flow/graph_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"""Module for parsing cylc graph strings."""

import re
import contextlib

from cylc.flow.exceptions import GraphParseError
from cylc.flow.param_expand import GraphExpander
Expand Down Expand Up @@ -506,6 +507,13 @@ def _add_trigger(self, orig_expr, rights, expr, info):
else:
members = [right]
for member in members:
with contextlib.suppress(KeyError):
# See GitHub cylc-flow#4333.
# If an identical trigger was already processed, check
# if it had a suicide marker and retain it if it did.
# i.e. if we have "a => b" and "a => !b" in the same graph,
# the suicide trigger takes precedence.
suicide = suicide or self.triggers[member][expr][1]
self.triggers.setdefault(member, {})
self.original.setdefault(member, {})
self.triggers[member][expr] = (trigs, suicide)
Expand Down
2 changes: 0 additions & 2 deletions cylc/flow/taskdef.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,6 @@ def get_parent_points(self, point):
if seq in self.dependencies:
# task has prereqs in this sequence
for dep in self.dependencies[seq]:
if dep.suicide:
continue
Comment on lines -219 to -220
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was preventing the upstream parent of a suicide trigger being recognized as a parent (matters for spawning if the suicided task has no other parents).

for trig in dep.task_triggers:
parent_points.add(trig.get_parent_point(point))
return parent_points
Expand Down