storagefsm: Apply global events even in broken states
This commit is contained in:
parent
0a8d20eb4e
commit
9a2ec07837
8
extern/storage-sealing/fsm.go
vendored
8
extern/storage-sealing/fsm.go
vendored
@ -241,9 +241,17 @@ func (m *Sealing) plan(events []statemachine.Event, state *SectorInfo) (func(sta
|
|||||||
}
|
}
|
||||||
|
|
||||||
p := fsmPlanners[state.State]
|
p := fsmPlanners[state.State]
|
||||||
|
if p == nil {
|
||||||
|
if len(events) == 1 {
|
||||||
|
if _, ok := events[0].User.(globalMutator); ok {
|
||||||
|
p = planOne() // in case we're in a really weird state, allow restart / update state / remove
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if p == nil {
|
if p == nil {
|
||||||
return nil, 0, xerrors.Errorf("planner for state %s not found", state.State)
|
return nil, 0, xerrors.Errorf("planner for state %s not found", state.State)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
processed, err := p(events, state)
|
processed, err := p(events, state)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user