pgraph: Move the BackPoke to before the semaphores
I can't think of a reason we should grab a semaphore before backpoking. The semaphore is intended to block around the actual work in CheckApply, not the dependency resolution of the correct vertex.
This commit is contained in:
@@ -169,6 +169,18 @@ func (g *Graph) Process(v *Vertex) error {
|
|||||||
defer obj.SetState(resources.ResStateNil) // reset state when finished
|
defer obj.SetState(resources.ResStateNil) // reset state when finished
|
||||||
obj.SetState(resources.ResStateProcess)
|
obj.SetState(resources.ResStateProcess)
|
||||||
|
|
||||||
|
// is it okay to run dependency wise right now?
|
||||||
|
// if not, that's okay because when the dependency runs, it will poke
|
||||||
|
// us back and we will run if needed then!
|
||||||
|
if !g.OKTimestamp(v) {
|
||||||
|
go g.BackPoke(v)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
// timestamp must be okay...
|
||||||
|
if g.Flags.Debug {
|
||||||
|
log.Printf("%s[%s]: OKTimestamp(%v)", obj.Kind(), obj.GetName(), v.GetTimestamp())
|
||||||
|
}
|
||||||
|
|
||||||
// semaphores!
|
// semaphores!
|
||||||
// These shouldn't ever block an exit, since the graph should eventually
|
// These shouldn't ever block an exit, since the graph should eventually
|
||||||
// converge causing their them to unlock. More interestingly, since they
|
// converge causing their them to unlock. More interestingly, since they
|
||||||
@@ -191,18 +203,6 @@ func (g *Graph) Process(v *Vertex) error {
|
|||||||
|
|
||||||
var ok = true
|
var ok = true
|
||||||
var applied = false // did we run an apply?
|
var applied = false // did we run an apply?
|
||||||
// is it okay to run dependency wise right now?
|
|
||||||
// if not, that's okay because when the dependency runs, it will poke
|
|
||||||
// us back and we will run if needed then!
|
|
||||||
if !g.OKTimestamp(v) {
|
|
||||||
go g.BackPoke(v)
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
// timestamp must be okay...
|
|
||||||
|
|
||||||
if g.Flags.Debug {
|
|
||||||
log.Printf("%s[%s]: OKTimestamp(%v)", obj.Kind(), obj.GetName(), v.GetTimestamp())
|
|
||||||
}
|
|
||||||
|
|
||||||
// connect any senders to receivers and detect if values changed
|
// connect any senders to receivers and detect if values changed
|
||||||
if updated, err := obj.SendRecv(obj); err != nil {
|
if updated, err := obj.SendRecv(obj); err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user