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: Use a unique queue to visit nodes #3418

Merged
merged 3 commits into from Jul 8, 2020
Merged

Conversation

simster7
Copy link
Member

@simster7 simster7 commented Jul 8, 2020

No description provided.

@@ -127,6 +127,42 @@ func generatePhaseNodes(children []string, branchPhase wfv1.NodePhase) []phaseNo
return out
}

type uniqueQueue struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

own file and tests obvs

Copy link
Member Author

Choose a reason for hiding this comment

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

Working on it as we speak

// If a phaseNode has already existed, it will not be added silently
func (uq *uniquePhaseNodeQueue) add(nodes ...phaseNode) {
for _, node := range nodes {
key := fmt.Sprintf("%s-%s", node.nodeId, node.phase)
Copy link
Contributor

Choose a reason for hiding this comment

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

interesting

Copy link
Member Author

Choose a reason for hiding this comment

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

Quick explanation: if an omitted node is reached first from a step that succeeded, we consider the omitted node succeeded. However, it may be subsequently reached from another step that did not succeed. In that case we want to update the deduced status of the omitted node, and we may only do so by adding it to the queue.

Copy link
Member Author

Choose a reason for hiding this comment

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

(I added this explanation as a comment as well)

}

func (uq *uniquePhaseNodeQueue) pop() phaseNode {
var toPop phaseNode
Copy link
Contributor

Choose a reason for hiding this comment

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

could you call this head?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, much better name

@simster7 simster7 marked this pull request as ready for review July 8, 2020 19:25
@simster7 simster7 merged commit 0463f24 into argoproj:master Jul 8, 2020
simster7 added a commit that referenced this pull request Jul 8, 2020
@alexec alexec linked an issue Jul 8, 2020 that may be closed by this pull request
4 tasks
@alexec alexec removed a link to an issue Jul 8, 2020
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants