fix: Fixed parent level memoization broken. Fixes #11612 #11623
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #11612
Motivation
Previous commit of #11456 PR makes some error as described in #11612.
When there is a memoization in template level, it seems memoization is not applied to child.
When running workflow like in Verification,
<< Correct - Before apply commit of #11456 >>
<< Current >>
It seems memoized template not escape the pending status.
So it is required for this to work as it works originally.
Modifications
The reason why : I omitted the fulfilled condition of memoization in
executeTemplate
BEFORE commiting #11456 ,
executeTemplate
function Inoperator.go
works like below.(In aspect of working synchronization & memoization)
And as I just move the
if node == nil && processedTmpl.Memoize != nil ...
part below theif processedTmpl.Synchronization != nil ...
, memoization template node never have a chance to checked fulfilled.So the node goes down to
executeTemplate
logic, untilswitch processedTmpl.GetType()
exist.It makes the child step (or dag or so on) created even memoization hit.
To solve this problem, I need to reuse the
Check fulfilled node phrase
in original place and after the memoization checked.Original place
, needed to check it is fulfilled seperately.If this works correctly, I think the other logics will not be affected as Original place code still exist, and only memoization will use the other.
Verification
Test with UI for both STEP and DAG case.
Tests are also applied in
operator_test.go
STEP
DAG
Also test the case with synchronization with memoization, which deals with #11456
For Reviewers
Please tell me if you can expect any side effect by this change. Thanks.