mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-26 08:51:02 -06:00
core: log every 5s while waiting for dependencies
Helps to flush out deadlocks in the dependency graph
This commit is contained in:
parent
1a44b427a7
commit
9cd88810f4
17
dag/dag.go
17
dag/dag.go
@ -2,9 +2,11 @@ package dag
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"sort"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/hashicorp/go-multierror"
|
||||
)
|
||||
@ -197,8 +199,19 @@ func (g *AcyclicGraph) Walk(cb WalkFunc) error {
|
||||
readyCh := make(chan bool)
|
||||
go func(v Vertex, deps []Vertex, chs []<-chan struct{}, readyCh chan<- bool) {
|
||||
// First wait for all the dependencies
|
||||
for _, ch := range chs {
|
||||
<-ch
|
||||
for i, ch := range chs {
|
||||
DepSatisfied:
|
||||
for {
|
||||
select {
|
||||
case <-ch:
|
||||
break DepSatisfied
|
||||
case <-time.After(time.Second * 5):
|
||||
log.Printf("[DEBUG] vertex %s, waiting for: %s",
|
||||
VertexName(v), VertexName(deps[i]))
|
||||
}
|
||||
}
|
||||
log.Printf("[DEBUG] vertex %s, got dep: %s",
|
||||
VertexName(v), VertexName(deps[i]))
|
||||
}
|
||||
|
||||
// Then, check the map to see if any of our dependencies failed
|
||||
|
Loading…
Reference in New Issue
Block a user