sealing: fix finalize with cache only

This commit is contained in:
Łukasz Magiera 2020-02-02 20:36:15 +01:00
parent bd766ab3cd
commit 2d6f0cc589

View File

@ -4,6 +4,7 @@ import (
"context"
sectorbuilder "github.com/filecoin-project/go-sectorbuilder"
"github.com/filecoin-project/go-sectorbuilder/fs"
"golang.org/x/xerrors"
"github.com/filecoin-project/lotus/build"
@ -236,11 +237,14 @@ func (m *Sealing) handleFinalizeSector(ctx statemachine.Context, sector SectorIn
// TODO: Maybe wait for some finality
if err := m.sb.FinalizeSector(ctx.Context(), sector.SectorID); err != nil {
return ctx.Send(SectorCommitFailed{xerrors.Errorf("finalize sector: %w", err)})
if !xerrors.Is(err, fs.ErrNoSuitablePath) {
return ctx.Send(SectorFinalizeFailed{xerrors.Errorf("finalize sector: %w", err)})
}
log.Warnf("finalize sector: %v", err)
}
if err := m.sb.DropStaged(ctx.Context(), sector.SectorID); err != nil {
return ctx.Send(SectorCommitFailed{xerrors.Errorf("drop staged: %w", err)})
return ctx.Send(SectorFinalizeFailed{xerrors.Errorf("drop staged: %w", err)})
}
return ctx.Send(SectorFinalized{})