engine: graph: Don't deadlock on error
This simplifies the pause mechanism and also avoids a deadlock on error. If the Worker shuts down completely, but before we've been removed from the graph, then an attempted pause would deadlock if we didn't have an escape hatch here. This removes the unnecessary ack mechanism now that we have a synchronous channel send to represent the pausing, rather than an asynchronous channel closing.
This commit is contained in:
@@ -412,7 +412,7 @@ Loop:
|
||||
// being made safe with a sync.Once, we instead run a
|
||||
// close() call inside of the vertexRemoveFn function,
|
||||
// which should unblock resumeSignal so we can shutdown.
|
||||
obj.state[vertex].pausedAck.Ack() // send ack
|
||||
|
||||
// we are paused now, and waiting for resume or exit...
|
||||
select {
|
||||
case _, closed = <-obj.state[vertex].resumeSignal: // channel closes
|
||||
|
||||
Reference in New Issue
Block a user