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 sequence bounds check for parent tasks. #3756

Merged
merged 2 commits into from
Aug 19, 2020

Conversation

hjoliver
Copy link
Member

@hjoliver hjoliver commented Aug 6, 2020

This change addresses a bug (and untested functionality, evidently) found by @TomekTrzeciak in #3740 (comment)

In the following example, bar should trigger off of foo in the first 3 cycles, then subsequent bar's should trigger automatically (no parents):

R3//P1 = "foo => bar"
P1 = "bar"

On this branch it works, but on master the scheduler shuts down finished after cycle point 3.

Since spawn-on-demand we auto-spawn parent-less tasks when their previous instance leaves the runahead pool (they have no parents to spawn them "on demand"). In this example, bar.3 has a parent (foo.3) but bar.4 has no parents and so has to be auto-spawned. To do this, when bar.3 leaves the runahead pool we look at the next cycle point for bar and see if it has parents there by looking for parents in each of its sequences. This parent-lookup gave the wrong result because sequence.is_on_sequence(point) disregards sequence bounds. The fix is to use sequence.is_valid(point) (which correctly says that bar.4 has no parents).

Marking as Draft until I add a test.

Requirements check-list

  • I have read CONTRIBUTING.md and added my name as a Code Contributor.
  • Contains logically grouped changes (else tidy your branch by rebase).
  • Does not contain off-topic changes (use other PRs for other changes).
  • Appropriate tests are included (unit and/or functional).
  • No change log entry needed (fixes a very recent never-released bug)
  • No documentation update required
  • No dependency changes.

@hjoliver hjoliver added the bug Something is wrong :( label Aug 6, 2020
@hjoliver hjoliver added this to the cylc-8.0a3 milestone Aug 6, 2020
@hjoliver hjoliver self-assigned this Aug 6, 2020
@hjoliver
Copy link
Member Author

hjoliver commented Aug 6, 2020

Proof the fix works:

$ cylc cat-log foo | grep triggered
2020-08-06T15:59:47+12:00 INFO - [foo.1] -triggered off []
2020-08-06T15:59:48+12:00 INFO - [foo.2] -triggered off []
2020-08-06T16:00:01+12:00 INFO - [bar.1] -triggered off ['foo.1']
2020-08-06T16:00:01+12:00 INFO - [bar.2] -triggered off ['foo.2']
2020-08-06T16:00:02+12:00 INFO - [bar.3] -triggered off []
2020-08-06T16:00:02+12:00 INFO - [bar.4] -triggered off []
2020-08-06T16:00:03+12:00 INFO - [bar.5] -triggered off []
2020-08-06T16:00:15+12:00 INFO - [bar.6] -triggered off []
2020-08-06T16:00:16+12:00 INFO - [bar.7] -triggered off []
...

@hjoliver
Copy link
Member Author

(rebased)

@hjoliver hjoliver marked this pull request as ready for review August 19, 2020 11:45
@hjoliver
Copy link
Member Author

Minimal functional test added (fails on master, passes here).

Copy link
Member

@oliver-sanders oliver-sanders left a comment

Choose a reason for hiding this comment

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

Good, tested with the following:

[scheduling]
    initial cycle point = 1 
    final cycle point = 9 
    cycling mode = integer
    [[graph]]
        R3//P1 = a => b
        P1 = b 
        6/P1 = b => c

@MetRonnie MetRonnie merged commit 69191f3 into cylc:master Aug 19, 2020
@hjoliver hjoliver deleted the sod-bugfix-tt branch August 19, 2020 19:59
@hjoliver hjoliver modified the milestones: cylc-8.0a3, cylc-8.0b0 Feb 25, 2021
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