Skip to content

Commit

Permalink
Ensure we don't leak any goroutines.
Browse files Browse the repository at this point in the history
Signed-off-by: gotjosh <[email protected]>
  • Loading branch information
gotjosh committed Sep 26, 2024
1 parent 553dbd5 commit 23f182a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/storage/ingest/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -1269,6 +1269,9 @@ func (r *concurrentFetchers) start(ctx context.Context, startOffset int64, concu
)
nextFetch.bytesPerRecord = 10_000 // start with an estimation, we will update it as we consume

// We need to make sure we don't leak any goroutine given that start is called within a goroutine.
r.wg.Add(1)
defer r.wg.Done()
for {
refillBufferedResult := nextResult
if readyBufferedResults != nil {
Expand Down

0 comments on commit 23f182a

Please sign in to comment.