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 :-) |
codeboten
left a comment
There was a problem hiding this comment.
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. |
codeboten
left a comment
There was a problem hiding this comment.
Thanks for addressing my feedback 👍🏻
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