From 58843857e52ad721328013bc406c35b60913176f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Mon, 21 Mar 2022 10:32:03 +0100 Subject: [PATCH] fix: sealing: always do cooldown in handleSubmitReplicaUpdateFailed --- extern/storage-sealing/input.go | 4 ++++ extern/storage-sealing/states_failed.go | 12 ++++-------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/extern/storage-sealing/input.go b/extern/storage-sealing/input.go index d2b51edc9..b70bd809b 100644 --- a/extern/storage-sealing/input.go +++ b/extern/storage-sealing/input.go @@ -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 { @@ -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 { diff --git a/extern/storage-sealing/states_failed.go b/extern/storage-sealing/states_failed.go index 90fa5090a..dedba2fc6 100644 --- a/extern/storage-sealing/states_failed.go +++ b/extern/storage-sealing/states_failed.go @@ -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{}) } @@ -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{}) }