Skip to content

[SDK] Fix not reporting failures from MultiSpanProcessor/MultiLogRecordProcessor flush/shutdown - #4472

Open
denizariyan wants to merge 2 commits into
open-telemetry:mainfrom
denizariyan:fix/not-reporting-multiprocessor-fail
Open

[SDK] Fix not reporting failures from MultiSpanProcessor/MultiLogRecordProcessor flush/shutdown#4472
denizariyan wants to merge 2 commits into
open-telemetry:mainfrom
denizariyan:fix/not-reporting-multiprocessor-fail

Conversation

@denizariyan

@denizariyan denizariyan commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Fixes #4471

Changes

MultiSpanProcessor::ForceFlush, MultiSpanProcessor::InternalShutdown and MultiLogRecordProcessor::InternalShutdown walk their children accumulating a bool result that is initialised to true and then combined with |=, so no child can ever move it off true.

  • Replaced the three |= accumulations with if (!child) { result = false; }. If statement results in same instructions (i.e., no added branching) and is more readable and harder to get wrong.
    • TracerContext/LoggerContext wrap the processor vector in a Multi* unconditionally, so this was returning a meaningless true even for users who configured a single processor.
  • MultiSpanProcessor had no test file anywhere in the tree and MultiLogRecordProcessor's only coverage was three Enabled-related tests living inside simple_log_record_processor_test.cc. I added multi_span_processor_test.cc and multi_log_record_processor_test.cc, and moved those three existing tests into the latter so each Multi* component is tested from a file named after it. The moved tests are unchanged apart from the suite name and dropping the now-redundant MultiLogRecordProcessor prefix from their names.

For significant contributions please make sure you have completed the following items:

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

@denizariyan
denizariyan force-pushed the fix/not-reporting-multiprocessor-fail branch from 3161d5e to 868816a Compare August 23, 2026 21:40
@denizariyan
denizariyan marked this pull request as ready for review August 23, 2026 21:43
@denizariyan
denizariyan requested a review from a team as a code owner August 23, 2026 21:43
@codecov

codecov Bot commented Aug 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.13%. Comparing base (cd252b4) to head (8e15293).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4472      +/-   ##
==========================================
+ Coverage   83.09%   83.13%   +0.04%     
==========================================
  Files         519      519              
  Lines       20253    20256       +3     
==========================================
+ Hits        16827    16837      +10     
+ Misses       3426     3419       -7     
Files with missing lines Coverage Δ
...ude/opentelemetry/sdk/trace/multi_span_processor.h 100.00% <100.00%> (+6.58%) ⬆️
sdk/src/logs/multi_log_record_processor.cc 96.48% <100.00%> (+0.05%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@denizariyan
denizariyan force-pushed the fix/not-reporting-multiprocessor-fail branch from 868816a to 7c5a260 Compare August 24, 2026 05:12

@dbarker dbarker left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix! Appreciate the test cleanup also.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] MultiSpanProcessor/MultiLogRecordProcessor: ForceFlush and Shutdown always return true

2 participants