Commit 2588e15
[exporterhelper][batcher] - Fix the bug related to worker pool (#13689)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
While working on an unrelated tasks, I observed unrestricted number of
`partitionBatcher.flush(..)` being spinned. This resulted in
`ConsumeLogs` being called excessively.
If I understand correctly, we're supposed to return the worker to
`qb.workerPool` only when the `consumeFunc` has returned. Right now,
we're calling the `consumeFunc` in a background goroutine and returning
the worker immediately in the main goroutine.
Here's the previous behaviour for comparision:
https://github.com/open-telemetry/opentelemetry-collector/pull/13164/files#diff-e3328327e734297f98f035f3eb463dc25c06843b82e6d48053020a94df0b9e94L189-L198
<!--Describe what testing was performed and which tests were added.-->
#### Testing
Did manual testing and verified the number of goroutines via profiling.
---------
Co-authored-by: Bogdan Drutu <[email protected]>1 parent 1d58da3 commit 2588e15
File tree
2 files changed
+31
-2
lines changed- .chloggen
- exporter/exporterhelper/internal/queuebatch
2 files changed
+31
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
Lines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
261 | 261 | | |
262 | 262 | | |
263 | 263 | | |
264 | | - | |
265 | | - | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
266 | 270 | | |
267 | 271 | | |
268 | 272 | | |
| |||
0 commit comments