fix(sdk-trace, sdk-logs): invoke all lifecycle processors - #6980
fix(sdk-trace, sdk-logs): invoke all lifecycle processors#6980teamleaderleo wants to merge 1 commit into
Conversation
|
|
|
Welcome, contributor! Thank you for your contribution to opentelemetry-js. Important reminders:
|
Pull request dashboard statusWaiting on reviewers · refreshed 2026-08-21 01:37 UTC Review the latest changes. Also blocked by: Merge conflicts. Status above doesn't look right?
|
625e900 to
3c339f2
Compare
Signed-off-by: Leo Li <cheerleaderleo@outlook.com> Assisted-by: ChatGPT GPT-5.6 Thinking
3c339f2 to
1e5bd20
Compare
Which problem is this PR solving?
Trace and log processor fanout can skip processors that were present when
shutdown()orforceFlush()began.A processor that throws synchronously can stop construction of later promise inputs. A processor can also mutate the retained processor array during fanout and remove another processor from the current operation. In
TracerProvider.forceFlush(), a synchronous throw can bypass the normal rejection path and leave that processor's timeout armed until expiry.This change keeps the existing result and error policies while ensuring every processor in the opening set receives its lifecycle call. It adds no dependencies and makes no public API or configuration changes.
Fixes #6977
Short description of the changes
TracerProvider.forceFlush()timers through the existing failure path.Metrics remains out of scope because its collector list is internally constructed and its lifecycle methods already cross an asynchronous boundary.
Type of change
How Has This Been Tested?
Eleven regression tests cover:
MultiSpanProcessor.forceFlush()andshutdown();MultiLogRecordProcessor.forceFlush()andshutdown();The candidate tree has passed the repository's Unit Tests, Lint, E2E, Bundler, W3C Trace Context, CodeQL, API peer-dependency, and security-analysis workflows.
Checklist:
Changelog entries are included for the stable trace SDK and experimental logs SDK.