Skip to content
This repository has been archived by the owner on Feb 1, 2023. It is now read-only.

Commit

Permalink
Merge pull request #504 from ipfs/fix/task-worker-count-race
Browse files Browse the repository at this point in the history
fix: hold the task worker lock when starting task workers
  • Loading branch information
Stebalien authored Jun 24, 2021
2 parents f2385cb + 24c356f commit d48cee0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/decision/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,9 @@ func (e *Engine) StartWorkers(ctx context.Context, px process.Process) {
e.bsm.start(px)
e.startScoreLedger(px)

e.taskWorkerLock.Lock()
defer e.taskWorkerLock.Unlock()

for i := 0; i < e.taskWorkerCount; i++ {
px.Go(func(px process.Process) {
e.taskWorker(ctx)
Expand Down

0 comments on commit d48cee0

Please sign in to comment.