storagefsm: Apply global events even in broken states
This commit is contained in:
parent
0a8d20eb4e
commit
9a2ec07837
10
extern/storage-sealing/fsm.go
vendored
10
extern/storage-sealing/fsm.go
vendored
@ -242,7 +242,15 @@ func (m *Sealing) plan(events []statemachine.Event, state *SectorInfo) (func(sta
|
||||
|
||||
p := fsmPlanners[state.State]
|
||||
if p == nil {
|
||||
return nil, 0, xerrors.Errorf("planner for state %s not found", state.State)
|
||||
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 {
|
||||
return nil, 0, xerrors.Errorf("planner for state %s not found", state.State)
|
||||
}
|
||||
}
|
||||
|
||||
processed, err := p(events, state)
|
||||
|
Loading…
Reference in New Issue
Block a user