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

Fix suicide trigger & logic #2656

Merged
merged 5 commits into from
May 10, 2018
Merged

Conversation

matthewrmshin
Copy link
Contributor

Also flatten single item in "(...)" in graph. Fix #2655.

Also flatten single item in "(...)" in graph.
@matthewrmshin matthewrmshin added the bug Something is wrong :( label May 8, 2018
@matthewrmshin matthewrmshin added this to the next release milestone May 8, 2018
@matthewrmshin matthewrmshin self-assigned this May 8, 2018
@matthewrmshin
Copy link
Contributor Author

(Actually, please hold review.)

self.remove(itask, 'suicide')
num_removed += 1
if (itask.state.suicide_prerequisites and
itask.state.suicide_prerequisites_are_all_satisfied()):
Copy link
Member

@oliver-sanders oliver-sanders May 8, 2018

Choose a reason for hiding this comment

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

Use of itask.state.suicide_prerequisites_are_all_satisfied is purposeful. This may cause issues where multiple suicide triggers are used in combination, see https://github.com/cylc/cylc/pull/2523/files#diff-9e759d26a5f403f3e52c71605f48269cR966.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But I cannot see how you can change it to not break this case - when the prerequisite list implies the & logic.

showdown:good => good & ! bad & ! ugly
showdown:bad => bad & ! good & ! ugly
showdown:ugly => ugly & ! good & ! bad
showdown:good => good
Copy link
Member

Choose a reason for hiding this comment

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

Does this still test for #2523?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK. The old logic implies something like showdown:good & showdown:bad => ! ugly. Need to find out what that will do!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

(Obviously, the test has been modified to test the | logic. I'll add another test to do the & logic for outputs from the same task.)

Copy link
Member

@oliver-sanders oliver-sanders May 9, 2018

Choose a reason for hiding this comment

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

Looking back at #2523, it would appear that it was the triangle arrangement of tasks which triggered the bug so the new 19-and-suicide.t won't test for this. If might be easier to keep the old test, as the & and | versions should be equivalent the test aught to pass using the same reference file:

{% if AND %}
                showdown:good => good & ! bad & ! ugly
                showdown:bad => bad & ! good & ! ugly
                showdown:ugly => ugly & ! good & ! bad
{% else %}
                showdown:bad => bad
                showdown:ugly => ugly
                showdown:good | showdown:bad => ! ugly
                showdown:good | showdown:ugly => ! bad
                showdown:bad | showdown:ugly => ! good
{% endif %}
                good | bad | ugly => fin

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If you re-factor the original graph to make it a bit easier to understand, it would look like this:

showdown:good => good
showdown:bad => bad
showdown:ugly => ugly
showdown:good & showdown:bad => ! ugly
showdown:good & showdown:ugly => ! bad
showdown:bad & showdown:ugly => ! good

It does not work, because showdown's script only send one output message at a time, so the & output logic should never satisfy the suicide triggers.

Copy link
Member

Choose a reason for hiding this comment

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

Triangle logic no longer tested, probably not necessary.

Copy link
Contributor Author

@matthewrmshin matthewrmshin May 9, 2018

Choose a reason for hiding this comment

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

I have now modified test 20 to do the original graph, but with new scripts to ensure the correct behaviour for message/output. Note:

showdown:good => good & ! bad & ! ugly
showdown:bad => bad & ! good & ! ugly
showdown:ugly => ugly & ! good & ! bad

# is the same as:

showdown:good => good
showdown:good => ! bad
showdown:good => ! ugly
showdown:bad => bad
showdown:bad => ! good
showdown:bad => ! ugly
showdown:ugly => ugly
showdown:ugly => ! good
showdown:ugly => ! bad

# Rearrange:

showdown:good => good
showdown:bad => bad
showdown:ugly => ugly

showdown:good => ! ugly
showdown:bad => ! ugly

showdown:good => ! bad
showdown:ugly => ! bad

showdown:bad => ! good
showdown:ugly => ! good

# Group by RHS, we have:

showdown:good => good
showdown:bad => bad
showdown:ugly => ugly
showdown:good & showdown:bad => ! ugly
showdown:good & showdown:ugly => ! bad
showdown:bad & showdown:ugly => ! good

@matthewrmshin
Copy link
Contributor Author

This should now be good, with enough tests to cover various cases.

Modify test 20 to look like test 17. Comment to explain the logic.
Modify the script message logic to support the correct behaviour.
@hjoliver hjoliver merged commit da74359 into cylc:master May 10, 2018
@matthewrmshin matthewrmshin deleted the fix-suicide-trigger branch May 10, 2018 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is wrong :(
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants