-
Notifications
You must be signed in to change notification settings - Fork 438
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
Fix leak in Jaeger exporter #1160
Conversation
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.
LGTM. Thanks for the fix.
Agree, Jaeger exporter tests need to be improved.
Codecov Report
@@ Coverage Diff @@
## main #1160 +/- ##
=======================================
Coverage 93.38% 93.38%
=======================================
Files 165 165
Lines 6233 6233
=======================================
Hits 5820 5820
Misses 413 413 |
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 the fix.
LGTM.
I will add more tests without mock to cover Thrift
part.
Great! Was thinking of looking into this, but just let me know If I can be of any help. |
We can catch the leak in the new test. |
@bjosv - can you update the branch to main, to allow this to be merged. |
The jaeger_span was never destroyed after its release from the JaegerRecordable. This change let a `std::unique_ptr` handle the destruction when going out of scope, first allowing the `thrift::Span` to be copied to the `span_buffer_`.
902fdfe
to
be83b1d
Compare
@lalitb The PR has now been updated to the latest from main. |
CI step It doesn't seem to be related to my correction according to the output, but I'm not familiar with the test. |
Thanks for catching and fixing. |
During our introduction of Jaeger and using the
JaegerExporter
we found this memory leak.There is currently no unittest for the
JaegerExporter
in opentelemetry-cpp that could have caught this, but maybe we should add something similar to the ongoingZipkinExporter
test (#1155)?Changes
The jaeger_span was never destroyed after its release from the JaegerRecordable.
This change let a
std::unique_ptr
handle the destruction when going out of scope, first allowing thethrift::Span
to be copied to thespan_buffer_
.For significant contributions please make sure you have completed the following items:
CHANGELOG.md
updated for non-trivial changes