Skip to content

Commit 3de9287

Browse files
committed
go/worker/storage/committee: Fix worker teardown
Previously the fetch pool was closed first, which caused doneCh to never be closed, which cause wg.Wait to never finish. There is no need for the doneCh as fetchPool.Stop already ensures all worker threads have stopped, and the queue of pending tasks is emptied. In other words we are guranteed no side effects.
1 parent 209fcc9 commit 3de9287

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

.changelog/6444.bugfix.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
go/worker/storage/committee: Fix worker teardown

go/worker/storage/committee/worker.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,12 +1086,9 @@ func (w *Worker) Serve(ctx context.Context) error { // nolint: gocyclo
10861086
rootType := prevRoots[i].Type
10871087
if !syncing.outstanding.contains(rootType) && syncing.awaitingRetry.contains(rootType) {
10881088
syncing.scheduleDiff(rootType)
1089-
doneCh := fetchPool.Submit(func() {
1089+
_ = fetchPool.Submit(func() {
10901090
w.fetchDiff(ctx, this.Round, prevRoots[i], this.Roots[i])
10911091
})
1092-
wg.Go(func() {
1093-
<-doneCh
1094-
})
10951092
}
10961093
}
10971094
}

0 commit comments

Comments
 (0)