Skip to content

Commit 5881258

Browse files
committed
fix: use group context for parallel extraction
1 parent 506e0cf commit 5881258

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tasks/actorstate/miner/sector_events.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,11 @@ func (SectorEventsExtractor) Extract(ctx context.Context, a actorstate.ActorInfo
6060

6161
} else {
6262
// If the miner has previous state compute the list of new sectors and precommit in its current state.
63-
grp, ctx := errgroup.WithContext(ctx)
63+
grp, grpCtx := errgroup.WithContext(ctx)
6464
grp.Go(func() error {
6565
start := time.Now()
6666
// collect changes made to miner precommit map (HAMT)
67-
preCommitChanges, err = node.DiffPreCommits(ctx, a.Address, a.Current, a.Executed, extState.ParentState(), extState.CurrentState())
67+
preCommitChanges, err = node.DiffPreCommits(grpCtx, a.Address, a.Current, a.Executed, extState.ParentState(), extState.CurrentState())
6868
if err != nil {
6969
return fmt.Errorf("diffing precommits %w", err)
7070
}
@@ -74,7 +74,7 @@ func (SectorEventsExtractor) Extract(ctx context.Context, a actorstate.ActorInfo
7474
grp.Go(func() error {
7575
start := time.Now()
7676
// collect changes made to miner sector array (AMT)
77-
sectorChanges, err = node.DiffSectors(ctx, a.Address, a.Current, a.Executed, extState.ParentState(), extState.CurrentState())
77+
sectorChanges, err = node.DiffSectors(grpCtx, a.Address, a.Current, a.Executed, extState.ParentState(), extState.CurrentState())
7878
if err != nil {
7979
return fmt.Errorf("diffing sectors %w", err)
8080
}
@@ -84,7 +84,7 @@ func (SectorEventsExtractor) Extract(ctx context.Context, a actorstate.ActorInfo
8484
grp.Go(func() error {
8585
start := time.Now()
8686
// collect changes made to miner sectors across all miner partition states
87-
sectorStateChanges, err = DiffMinerSectorStates(ctx, extState)
87+
sectorStateChanges, err = DiffMinerSectorStates(grpCtx, extState)
8888
if err != nil {
8989
return fmt.Errorf("diffing sector states %w", err)
9090
}

0 commit comments

Comments
 (0)