From 9b52b06ea9163fb9952aa1523940c7534bf6a8d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Tue, 4 Jul 2023 13:35:49 +0200 Subject: [PATCH] fix: sealing: Fix RetryCommitWait loop when sector cron activation fails --- storage/pipeline/states_failed.go | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/storage/pipeline/states_failed.go b/storage/pipeline/states_failed.go index d952d8eda..8bad4cee3 100644 --- a/storage/pipeline/states_failed.go +++ b/storage/pipeline/states_failed.go @@ -301,8 +301,21 @@ func (m *Sealing) handleCommitFailed(ctx statemachine.Context, sector SectorInfo switch mw.Receipt.ExitCode { case exitcode.Ok: - // API error in CcommitWait - return ctx.Send(SectorRetryCommitWait{}) + si, err := m.Api.StateSectorGetInfo(ctx.Context(), m.maddr, sector.SectorNumber, mw.TipSet) + if err != nil { + // API error + if err := failedCooldown(ctx, sector); err != nil { + return err + } + + return ctx.Send(SectorRetryCommitWait{}) + } + if si != nil { + // API error in CommitWait? + return ctx.Send(SectorRetryCommitWait{}) + } + // if si == nil, something else went wrong; Likely expired deals, we'll + // find out in checkCommit case exitcode.SysErrOutOfGas: // API error in CommitWait AND gas estimator guessed a wrong number in SubmitCommit return ctx.Send(SectorRetrySubmitCommit{})