-
Notifications
You must be signed in to change notification settings - Fork 1.7k
otelcol: use sync.Once in Shutdown #13741
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
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.
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
Have you tried reproducing the issue in a unit test? |
@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. |
@dmathieu done - the test now reliably triggers the bug on main |
There was a problem hiding this 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?
@bogdandrutu IMO yes, but not as a solution to this particular problem |
There was a problem hiding this 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.
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