Merge pull request #8386 from zl03jsj/fix/dead_loop_on_remove_sector

fix: miner: dead loop on removing sector
This commit is contained in:
Łukasz Magiera 2022-03-28 12:51:53 -04:00 committed by GitHub
commit 029610fb40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -320,7 +320,7 @@ var fsmPlanners = map[SectorState]func(events []statemachine.Event, state *Secto
FaultReported: final, // not really supported right now
FaultedFinal: final,
Removed: final,
Removed: finalRemoved,
FailedUnrecoverable: final,
}
@ -694,6 +694,12 @@ func (m *Sealing) ForceSectorState(ctx context.Context, id abi.SectorNumber, sta
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) {
if len(events) > 0 {
if gm, ok := events[0].User.(globalMutator); ok {