elastic / go-elasticsearch

The official Go client for Elasticsearch
https://github.com/elastic/go-elasticsearch#go-elasticsearch
Apache License 2.0
65 stars 617 forks source link

Bulk indexer: Follow convention and increment waitgroup in loop before creating goroutines #891

Closed HaraldNordgren closed 4 months ago

HaraldNordgren commented 4 months ago

The wg Delta should generally be added before relevant go-routines are launched. Reference: https://pkg.go.dev/sync#WaitGroup.Add

This also aligns the code with our other uses of waitgroups.

Closes https://github.com/elastic/go-elasticsearch/issues/796.

HaraldNordgren commented 4 months ago

Ping @Anaethelion @Jakub-Kapusta