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
Copy link

codecov bot commented Sep 1, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.39%. Comparing base (f8af86c) to head (60985e4).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13741      +/-   ##
==========================================
- Coverage   91.42%   91.39%   -0.03%     
==========================================
  Files         641      641              
  Lines       42670    42666       -4     
==========================================
- Hits        39011    38996      -15     
- Misses       2839     2847       +8     
- Partials      820      823       +3     

☔ 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
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
6 participants