Merge pull request #8386 from zl03jsj/fix/dead_loop_on_remove_sector
fix: miner: dead loop on removing sector
This commit is contained in:
commit
029610fb40
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
|
||||
|
||||
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 {
|
||||
|
Loading…
Reference in New Issue
Block a user