-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Remove memory leak at exporter shutdown #11745
Remove memory leak at exporter shutdown #11745
Conversation
You will need to sign the CLA. |
Yep, waiting for our CLA manager to approve |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #11745 +/- ##
==========================================
- Coverage 91.55% 91.54% -0.01%
==========================================
Files 445 445
Lines 23715 23733 +18
==========================================
+ Hits 21712 21727 +15
- Misses 1627 1629 +2
- Partials 376 377 +1 ☔ View full report in Codecov by Sentry. |
f592107
to
011d62e
Compare
a6ffebe
to
c42de6c
Compare
ae1515d
to
b302466
Compare
@codeboten , I think you might be the right person to review and merge this :-) |
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.
thanks @mahadzaryab1! is it possible to add a test to validate the shutdown behaviour in the queue sender?
I'm curious if there's a way we could prevent these in the future, it doesnt look like goleak is detecting this today
I assume this was supposed to be me :D
Will look into this. As far as I can tell, the callback is called during collection cycle, so if we trigger a metric collection after queue shutdown, we should not be seeing the metrics.
I have no idea, I'm relatively new to go, and this was my first ever memory leak investigation. |
I have now added a check in the queue sender metrics test to make sure the metrics are unregistered. |
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.
Thanks for addressing my feedback 👍🏻
71f7d9e
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description Fix memory leak at exporter shutdown. At startup time the exporter creates metric callbacks that hold references to the exporter queue, these need to be unregistered at shutdown. <!-- Issue number if applicable --> #### Link to tracking issue Fixes open-telemetry#11401 --------- Co-authored-by: Alex Boten <223565+codeboten@users.noreply.github.com>
Description
Fix memory leak at exporter shutdown. At startup time the exporter creates metric callbacks that hold references to the exporter queue, these need to be unregistered at shutdown.
Link to tracking issue
Fixes #11401