Skip to content

Commit

Permalink
Merge pull request #8386 from zl03jsj/fix/dead_loop_on_remove_sector
Browse files Browse the repository at this point in the history
fix: miner: dead loop on removing sector
  • Loading branch information
magik6k authored Mar 28, 2022
2 parents b8b33c4 + 1646edf commit 029610f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion extern/storage-sealing/fsm.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 029610f

Please sign in to comment.