fix: dead loop on removing a sector
This commit is contained in:
parent
2ad3a117f1
commit
01efb3b1a7
8
extern/storage-sealing/fsm.go
vendored
8
extern/storage-sealing/fsm.go
vendored
@ -320,7 +320,7 @@ var fsmPlanners = map[SectorState]func(events []statemachine.Event, state *Secto
|
|||||||
FaultReported: final, // not really supported right now
|
FaultReported: final, // not really supported right now
|
||||||
|
|
||||||
FaultedFinal: final,
|
FaultedFinal: final,
|
||||||
Removed: final,
|
Removed: finalRemoved,
|
||||||
|
|
||||||
FailedUnrecoverable: final,
|
FailedUnrecoverable: final,
|
||||||
}
|
}
|
||||||
@ -694,6 +694,12 @@ func (m *Sealing) ForceSectorState(ctx context.Context, id abi.SectorNumber, sta
|
|||||||
return m.sectors.Send(id, SectorForceState{state})
|
return m.sectors.Send(id, SectorForceState{state})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// as sector has been removed, it's no needs to care about later events,
|
||||||
|
// just returns length of events as `processed` is ok.
|
||||||
|
func finalRemoved(events []statemachine.Event, state *SectorInfo) (uint64, error) {
|
||||||
|
return uint64(len(events)), nil
|
||||||
|
}
|
||||||
|
|
||||||
func final(events []statemachine.Event, state *SectorInfo) (uint64, error) {
|
func final(events []statemachine.Event, state *SectorInfo) (uint64, error) {
|
||||||
if len(events) > 0 {
|
if len(events) > 0 {
|
||||||
if gm, ok := events[0].User.(globalMutator); ok {
|
if gm, ok := events[0].User.(globalMutator); ok {
|
||||||
|
Loading…
Reference in New Issue
Block a user