Repository navigation
[SDK] Fix BatchLogRecordProcessor batching and flush behavior - #4743
Conversation
…ing partial batches Align the logs batch processor with BatchSpanProcessor after open-telemetry#4466: * The worker waits until max_export_batch_size records are buffered before exporting on a regular wakeup. * ForceFlush()/Shutdown() drain everything buffered, split into batches of at most max_export_batch_size. * ForceFlush() returns only after all records buffered before the call have been exported. Fixes open-telemetry#4498
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4743 +/- ##
==========================================
- Coverage 86.51% 86.51% -0.00%
==========================================
Files 530 530
Lines 21138 21136 -2
==========================================
- Hits 18286 18284 -2
Misses 2852 2852
🚀 New features to boost your workflow:
|
|
checked whether this needs the locked notify from #4741, since my note there said logs would once the full-batch wait landed. it doesn't. stress probe with queue 2, batch 2 and a 10 min delay, one emit, a swept spin, then two more emits, 50k rounds per run. the worker sleeps through a full queue in 15 and 19 rounds on main and in 15 and 17 at d23cb0c, so that stall is older than this PR and unchanged by it. the #4741 change mirrored into |
Fixes #4498
Changes
Align BatchLogRecordProcessor batching behavior with the
BatchSpanProcessor fix in #4466.
draining the queue in a tight loop.
explicit wakeup occurs. Existing queue-pressure wakeups are preserved.
exporting records in batches capped by max_export_batch_size.
a previous ForceFlush has completed.
flush/shutdown batch limits, and behavior after ForceFlush.
No public API changes.
Testing
Validated locally on macOS with AppleClang, C++17, and a Debug build:
The full CI matrix has not been run locally.
Checklist
CHANGELOG.mdupdated for non-trivial changes