Merge pull request #2385 from venturehacks/panic_failed_to_get_edge
don't cast Value when pipe is erroredmaster
commit
d429b0b326
|
@ -458,7 +458,14 @@ func (e *edge) processUpdate(upt pipe.Receiver) (depChanged bool) {
|
||||||
dep.err = err
|
dep.err = err
|
||||||
}
|
}
|
||||||
|
|
||||||
state := upt.Status().Value.(*edgeState)
|
if upt.Status().Value == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
state, isEdgeState := upt.Status().Value.(*edgeState)
|
||||||
|
if !isEdgeState {
|
||||||
|
bklog.G(context.TODO()).Warnf("invalid edgeState value for update: %T", state)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if len(dep.keys) < len(state.keys) {
|
if len(dep.keys) < len(state.keys) {
|
||||||
newKeys := state.keys[len(dep.keys):]
|
newKeys := state.keys[len(dep.keys):]
|
||||||
|
|
|
@ -352,7 +352,7 @@ func (pf *pipeFactory) NewInputRequest(ee Edge, req *edgeRequest) pipe.Receiver
|
||||||
target := pf.s.ef.getEdge(ee)
|
target := pf.s.ef.getEdge(ee)
|
||||||
if target == nil {
|
if target == nil {
|
||||||
return pf.NewFuncRequest(func(_ context.Context) (interface{}, error) {
|
return pf.NewFuncRequest(func(_ context.Context) (interface{}, error) {
|
||||||
return req, errors.Errorf("failed to get edge: inconsistent graph state")
|
return nil, errors.Errorf("failed to get edge: inconsistent graph state")
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
p := pf.s.newPipe(target, pf.e, pipe.Request{Payload: req})
|
p := pf.s.newPipe(target, pf.e, pipe.Request{Payload: req})
|
||||||
|
|
Loading…
Reference in New Issue