Skip to content

[service] Start receivers after every other component type#15495

Merged
evan-bradley merged 5 commits into
open-telemetry:mainfrom
jade-guiton-dd:start-receivers-last
Jun 29, 2026
Merged

[service] Start receivers after every other component type#15495
evan-bradley merged 5 commits into
open-telemetry:mainfrom
jade-guiton-dd:start-receivers-last

Conversation

@jade-guiton-dd

Copy link
Copy Markdown
Member

Description

This PR constrains the start order of components so that receivers only start after every other type of component has started across all pipelines. Note that this is still reverse topological order, but with some of the free parameters fixed.

This avoids startup issues with pipelines like this:

receiver/1 → exporter/1
receiver/2 → exporter/2

in which receiver/1 and receiver/2 are two instances of a sharedcomponent.

Since receiver/1 and exporter/2 are in disconnected parts of the component graph, their order in the startup schedule is undefined, so the service might (depending on the hash of the component instance identities) decide to start receiver/1 before exporter/2. But since starting receiver/1 also starts receiver/2, which the service has no knowledge of, there is a chance for receiver/2 to emit data to an unstarted exporter/2, which violates the standard component lifecycle.

Link to tracking issue

Fixes #15485

Testing

I added a unit test in graph_test.go which checks that a shared receiver which eagerly sends data on startup does not send data to an unstarted exporter. This test fails with the previous code in graph.go.

Authorship

  • I, a human, wrote this pull request description myself.

@codecov

codecov Bot commented Jun 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.08%. Comparing base (767b013) to head (56a7d3e).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #15495      +/-   ##
==========================================
+ Coverage   91.03%   91.08%   +0.04%     
==========================================
  Files         726      726              
  Lines       47926    47939      +13     
==========================================
+ Hits        43631    43666      +35     
+ Misses       3000     2978      -22     
  Partials     1295     1295              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

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

@jade-guiton-dd
jade-guiton-dd marked this pull request as ready for review June 25, 2026 12:33
@jade-guiton-dd
jade-guiton-dd requested a review from a team as a code owner June 25, 2026 12:33
@jade-guiton-dd
jade-guiton-dd requested a review from codeboten June 25, 2026 12:33
Comment thread service/internal/graph/graph_test.go Outdated

@jmacd jmacd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Wow, neat.

@evan-bradley
evan-bradley added this pull request to the merge queue Jun 29, 2026
Merged via the queue into open-telemetry:main with commit 3e8f5a9 Jun 29, 2026
108 of 113 checks passed
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.

Shared receiver can start serving before consumers of its other-signal pipelines are started

5 participants