MCPcopy
hub / github.com/argoproj/argo-workflows / handleNodeFulfilled

Method handleNodeFulfilled

workflow/controller/operator.go:2531–2547  ·  view source on GitHub ↗
(ctx context.Context, nodeName string, node *wfv1.NodeStatus, processedTmpl *wfv1.Template)

Source from the content-addressed store, hash-verified

2529}
2530
2531func (woc *wfOperationCtx) handleNodeFulfilled(ctx context.Context, nodeName string, node *wfv1.NodeStatus, processedTmpl *wfv1.Template) *wfv1.NodeStatus {
2532 if node == nil || !node.Phase.Fulfilled(node.TaskResultSynced) {
2533 return nil
2534 }
2535
2536 woc.log.WithField("nodeName", nodeName).Debug(ctx, "Node already completed")
2537
2538 if processedTmpl.Metrics != nil {
2539 // Check if this node completed between executions. If it did, emit metrics.
2540 // We can infer that this node completed during the current operation, emit metrics
2541 if prevNodeStatus, ok := woc.preExecutionNodeStatuses[node.ID]; ok && !prevNodeStatus.Fulfilled() {
2542 localScope, realTimeScope := woc.prepareMetricScope(node)
2543 woc.computeMetrics(ctx, processedTmpl.Metrics.Prometheus, localScope, realTimeScope, false)
2544 }
2545 }
2546 return node
2547}
2548
2549// Checks if the template has exceeded its deadline
2550func (woc *wfOperationCtx) checkTemplateTimeout(tmpl *wfv1.Template, node *wfv1.NodeStatus) (*time.Time, error) {

Callers 1

executeTemplateMethod · 0.95

Calls 5

prepareMetricScopeMethod · 0.95
computeMetricsMethod · 0.95
DebugMethod · 0.65
WithFieldMethod · 0.65
FulfilledMethod · 0.45

Tested by

no test coverage detected