From d78f1e4eee7e9f895d74089a2992f0ac7e23f250 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Wed, 16 Mar 2022 21:29:57 +0100 Subject: [PATCH] sealing: Rename Sealing.creating to a less confusing name --- extern/storage-sealing/input.go | 10 +++++----- extern/storage-sealing/sealing.go | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/extern/storage-sealing/input.go b/extern/storage-sealing/input.go index b2fdeeaa3..723bd3545 100644 --- a/extern/storage-sealing/input.go +++ b/extern/storage-sealing/input.go @@ -33,8 +33,8 @@ func (m *Sealing) handleWaitDeals(ctx statemachine.Context, sector SectorInfo) e m.inputLk.Lock() - if m.creating != nil && *m.creating == sector.SectorNumber { - m.creating = nil + if m.nextDealSector != nil && *m.nextDealSector == sector.SectorNumber { + m.nextDealSector = nil } sid := m.minerSectorID(sector.SectorNumber) @@ -615,14 +615,14 @@ func (m *Sealing) tryGetUpgradeSector(ctx context.Context, sp abi.RegisteredSeal log.Infow("Upgrading sector", "number", candidate.Number, "type", "deal", "proofType", sp, "expiration", bestExpiration, "pledge", types.FIL(bestPledge)) delete(m.available, candidate) - m.creating = &candidate.Number + m.nextDealSector = &candidate.Number return true, m.sectors.Send(uint64(candidate.Number), SectorStartCCUpdate{}) } func (m *Sealing) tryGetDealSector(ctx context.Context, sp abi.RegisteredSealProof, ef expFn) error { m.startupWait.Wait() - if m.creating != nil { + if m.nextDealSector != nil { return nil // new sector is being created right now } @@ -656,7 +656,7 @@ func (m *Sealing) tryGetDealSector(ctx context.Context, sp abi.RegisteredSealPro return err } - m.creating = &sid + m.nextDealSector = &sid log.Infow("Creating sector", "number", sid, "type", "deal", "proofType", sp) return m.sectors.Send(uint64(sid), SectorStart{ diff --git a/extern/storage-sealing/sealing.go b/extern/storage-sealing/sealing.go index e9dc7d0ce..8f6cf3226 100644 --- a/extern/storage-sealing/sealing.go +++ b/extern/storage-sealing/sealing.go @@ -105,7 +105,7 @@ type Sealing struct { sectorTimers map[abi.SectorID]*time.Timer pendingPieces map[cid.Cid]*pendingPiece assignedPieces map[abi.SectorID][]cid.Cid - creating *abi.SectorNumber // used to prevent a race where we could create a new sector more than once + nextDealSector *abi.SectorNumber // used to prevent a race where we could create a new sector more than once upgradeLk sync.Mutex toUpgrade map[abi.SectorNumber]struct{}