From 91e474e72eff1ea4fab0706852c29cb98546a85f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Tue, 12 Jul 2022 13:09:20 +0200 Subject: [PATCH] sealer: Pass correct args to SubAllowed in selectors --- itests/kit/blockminer.go | 3 +++ storage/sealer/selector_alloc.go | 2 +- storage/sealer/selector_existing.go | 2 +- storage/sealer/selector_move.go | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/itests/kit/blockminer.go b/itests/kit/blockminer.go index df19d4efb..8f2d06b35 100644 --- a/itests/kit/blockminer.go +++ b/itests/kit/blockminer.go @@ -185,9 +185,12 @@ func (bm *BlockMiner) MineBlocksMustPost(ctx context.Context, blocktime time.Dur var target abi.ChainEpoch reportSuccessFn := func(success bool, epoch abi.ChainEpoch, err error) { + // if api shuts down before mining, we may get an error which we should probably just ignore + // (fixing it will require rewriting most of the mining loop) if err != nil && !strings.Contains(err.Error(), "websocket connection closed") { require.NoError(bm.t, err) } + target = epoch wait <- success } diff --git a/storage/sealer/selector_alloc.go b/storage/sealer/selector_alloc.go index d352d0c99..ce64820f7 100644 --- a/storage/sealer/selector_alloc.go +++ b/storage/sealer/selector_alloc.go @@ -59,7 +59,7 @@ func (s *allocSelector) Ok(ctx context.Context, task sealtasks.TaskType, spt abi for _, info := range best { if _, ok := have[info.ID]; ok { - requested = requested.SubAllowed(info.AllowTypes, info.AllowTypes) + requested = requested.SubAllowed(info.AllowTypes, info.DenyTypes) // got all paths if requested == storiface.FTNone { diff --git a/storage/sealer/selector_existing.go b/storage/sealer/selector_existing.go index 20a92dfb4..830213f1e 100644 --- a/storage/sealer/selector_existing.go +++ b/storage/sealer/selector_existing.go @@ -66,7 +66,7 @@ func (s *existingSelector) Ok(ctx context.Context, task sealtasks.TaskType, spt return true, false, nil } - requested = requested.SubAllowed(info.AllowTypes, info.AllowTypes) + requested = requested.SubAllowed(info.AllowTypes, info.DenyTypes) // got all paths if requested == storiface.FTNone { diff --git a/storage/sealer/selector_move.go b/storage/sealer/selector_move.go index 6473c6f63..c1f402456 100644 --- a/storage/sealer/selector_move.go +++ b/storage/sealer/selector_move.go @@ -87,7 +87,7 @@ func (s *moveSelector) Ok(ctx context.Context, task sealtasks.TaskType, spt abi. pref = true } - requested = requested.SubAllowed(info.AllowTypes, info.AllowTypes) + requested = requested.SubAllowed(info.AllowTypes, info.DenyTypes) // got all paths if requested == storiface.FTNone {