Skip to content

Commit

Permalink
Merge pull request #8353 from filecoin-project/fix/ru-retry-loop
Browse files Browse the repository at this point in the history
fix: sealing: always do cooldown in handleSubmitReplicaUpdateFailed
  • Loading branch information
magik6k authored Mar 21, 2022
2 parents 3c1edca + 5884385 commit 1a0fc75
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 4 additions & 0 deletions extern/storage-sealing/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,8 @@ func (m *Sealing) updateInput(ctx context.Context, sp abi.RegisteredSealProof) e
return matches[i].sector.Number < matches[j].sector.Number // prefer older sectors
})

log.Debugw("updateInput matching", "matches", len(matches), "toAssign", len(toAssign), "openSectors", len(m.openSectors), "pieces", len(m.pendingPieces))

var assigned int
for _, mt := range matches {
if m.pendingPieces[mt.deal].assigned {
Expand Down Expand Up @@ -506,6 +508,8 @@ func (m *Sealing) updateInput(ctx context.Context, sp abi.RegisteredSealProof) e
}
}

log.Debugw("updateInput matching done", "matches", len(matches), "toAssign", len(toAssign), "assigned", assigned, "openSectors", len(m.openSectors), "pieces", len(m.pendingPieces))

if len(toAssign) > 0 {
log.Errorf("we are trying to create a new sector with open sectors %v", m.openSectors)
if err := m.tryGetDealSector(ctx, sp, expF); err != nil {
Expand Down
12 changes: 4 additions & 8 deletions extern/storage-sealing/states_failed.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,14 @@ func (m *Sealing) handleComputeProofFailed(ctx statemachine.Context, sector Sect
}

func (m *Sealing) handleSubmitReplicaUpdateFailed(ctx statemachine.Context, sector SectorInfo) error {
if err := failedCooldown(ctx, sector); err != nil {
return err
}

if sector.ReplicaUpdateMessage != nil {
mw, err := m.Api.StateSearchMsg(ctx.Context(), *sector.ReplicaUpdateMessage)
if err != nil {
// API error
if err := failedCooldown(ctx, sector); err != nil {
return err
}

return ctx.Send(SectorRetrySubmitReplicaUpdateWait{})
}

Expand Down Expand Up @@ -248,10 +248,6 @@ func (m *Sealing) handleSubmitReplicaUpdateFailed(ctx statemachine.Context, sect
return ctx.Send(SectorAbortUpgrade{})
}

if err := failedCooldown(ctx, sector); err != nil {
return err
}

return ctx.Send(SectorRetrySubmitReplicaUpdate{})
}

Expand Down

0 comments on commit 1a0fc75

Please sign in to comment.