Skip to content

Commit 6b1470b

Browse files
committed
pkg/payload/task_graph: Require firstIncompleteNode to have tasks
Our graph has some nodes without tasks, e.g. nodes which create a choke point between two sets of parallel nodes. Ideally we give all nodes descriptive names [1], but until we have that, require at least one entry in Tasks before we store a node as firstIncompleteNode. This avoids the chance of panicking during the subsequent [2]: fmt.Errorf("%d incomplete task nodes, beginning with %s", incompleteCount, firstIncompleteNode.Tasks[0]) [1]: #435 [2]: https://bugzilla.redhat.com/show_bug.cgi?id=1903382
1 parent dc6f4f0 commit 6b1470b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/payload/task_graph.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ func RunGraph(ctx context.Context, graph *TaskGraph, maxParallelism int, fn func
536536
incompleteCount := 0
537537
for i, result := range results {
538538
if result == nil {
539-
if firstIncompleteNode == nil {
539+
if firstIncompleteNode == nil && len(graph.Nodes[i].Tasks) > 0 {
540540
firstIncompleteNode = graph.Nodes[i]
541541
}
542542
incompleteCount++

0 commit comments

Comments
 (0)