From 38350b8d8a9fd4bfed0cd65732b3ed8097919215 Mon Sep 17 00:00:00 2001 From: Shrenuj Bansal Date: Wed, 16 Aug 2023 17:20:39 -0400 Subject: [PATCH 1/2] Run unsealing in the background for better ux --- node/impl/storminer.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/node/impl/storminer.go b/node/impl/storminer.go index e4fa41c788a..e88c87256c4 100644 --- a/node/impl/storminer.go +++ b/node/impl/storminer.go @@ -278,7 +278,13 @@ func (sm *StorageMinerAPI) SectorUnseal(ctx context.Context, sectorNum abi.Secto ProofType: status.SealProof, } - return sm.StorageMgr.SectorsUnsealPiece(ctx, sector, storiface.UnpaddedByteIndex(0), abi.UnpaddedPieceSize(0), status.Ticket.Value, status.CommD) + bgCtx := context.Background() + + go func() { + sm.StorageMgr.SectorsUnsealPiece(bgCtx, sector, storiface.UnpaddedByteIndex(0), abi.UnpaddedPieceSize(0), status.Ticket.Value, status.CommD) + }() + + return nil } // List all staged sectors From 9e695764106ec560e5310635632a8fc2a7bd5eb3 Mon Sep 17 00:00:00 2001 From: Shrenuj Bansal Date: Wed, 16 Aug 2023 17:40:27 -0400 Subject: [PATCH 2/2] log unseal failures --- node/impl/storminer.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/node/impl/storminer.go b/node/impl/storminer.go index e88c87256c4..069cdff7f9f 100644 --- a/node/impl/storminer.go +++ b/node/impl/storminer.go @@ -281,7 +281,10 @@ func (sm *StorageMinerAPI) SectorUnseal(ctx context.Context, sectorNum abi.Secto bgCtx := context.Background() go func() { - sm.StorageMgr.SectorsUnsealPiece(bgCtx, sector, storiface.UnpaddedByteIndex(0), abi.UnpaddedPieceSize(0), status.Ticket.Value, status.CommD) + err := sm.StorageMgr.SectorsUnsealPiece(bgCtx, sector, storiface.UnpaddedByteIndex(0), abi.UnpaddedPieceSize(0), status.Ticket.Value, status.CommD) + if err != nil { + log.Errorf("unseal for sector %d failed: %+v", sectorNum, err) + } }() return nil