Skip to content

Conversation

@axw
Copy link
Contributor

@axw axw commented Sep 1, 2025

Description

Make sure that Shutdown closes the shutdown channel at most once, but don't use the collector state to determine this. That's because the state may be "closing" during a config reload.

Link to tracking issue

Fixes #13740

Testing

Applied diff in the linked issue, does not trigger the bug anymore.

Documentation

N/A

Make sure that Shutdown closes the shutdown channel at
most once, but don't use the collector state to determine
this. That's because the state may be "closing" during
a config reload.
@axw axw requested a review from a team as a code owner September 1, 2025 06:59
@axw axw requested a review from dmathieu September 1, 2025 06:59
@codecov
Copy link

codecov bot commented Sep 1, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.40%. Comparing base (e8135a8) to head (9cb981f).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13741      +/-   ##
==========================================
- Coverage   91.45%   91.40%   -0.06%     
==========================================
  Files         640      640              
  Lines       42668    42664       -4     
==========================================
- Hits        39023    38996      -27     
- Misses       2828     2845      +17     
- Partials      817      823       +6     

☔ View full report in Codecov by Sentry.
📢 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.

@dmathieu
Copy link
Member

dmathieu commented Sep 1, 2025

Have you tried reproducing the issue in a unit test?

@axw
Copy link
Contributor Author

axw commented Sep 1, 2025

@dmathieu only briefly. I can take another look tomorrow - basically we'd need to block the internal service shutdown on reload, and check that a Shutdown call isn't ignored.

@axw
Copy link
Contributor Author

axw commented Sep 2, 2025

@dmathieu done - the test now reliably triggers the bug on main

Copy link
Member

@bogdandrutu bogdandrutu left a comment

Choose a reason for hiding this comment

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

Should we have a "reloading" state instead and shutdown even in that?

@axw
Copy link
Contributor Author

axw commented Sep 3, 2025

@bogdandrutu IMO yes, but not as a solution to this particular problem

Copy link
Member

@bogdandrutu bogdandrutu left a comment

Choose a reason for hiding this comment

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

I think also we need to make a decision about Run after Shutdown and make sure clearly implemented in the code.

@dmathieu dmathieu added the ready-to-merge Code review completed; ready to merge by maintainers label Sep 4, 2025
@mx-psi mx-psi added this pull request to the merge queue Sep 10, 2025
Merged via the queue into open-telemetry:main with commit 70ad71d Sep 10, 2025
57 checks passed
@github-actions github-actions bot added this to the next release milestone Sep 10, 2025
@axw axw deleted the collector-shutdown branch September 10, 2025 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge Code review completed; ready to merge by maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[otelcol] Collector.Shutdown may be a no-op during config reload

7 participants