Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[no-aggregation] return the
MetricSampleBatch
to the pool only once…
… done with it (#17728) * [no-aggregation] return the `MetricSampleBatch` to the pool only once done with it. Returning the `MetricSampleBatch` earlier (in the `batcher.go`) was incorrect since the `NoAggregationStreamWorker` goroutine might still be using it to process its content. Returning it early was making the MetricSampleBatch available to any running `TimeSamplerWorker`s, which has the time to write (by indices) its sample in the MetricSampleBatch, eventually still processed (with access by index) by the `NoAggregationStreaWorker`, resulting in misuse of the metric sample (or its discard if it is a no-aggregation unsupported type such as Distribution and Histograms).
- Loading branch information