-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 goroutine leaks in several packages #5026
Conversation
Signed-off-by: Yuri Shkuro <github@ysh.us>
@@ -84,11 +89,6 @@ func initHelper( | |||
// span processor to aggregate spans before export. | |||
bsp := sdktrace.NewBatchSpanProcessor(traceExporter) | |||
|
|||
res, err := otelResource(ctx, svc) | |||
if err != nil { | |||
return nil, err |
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.
this was leaking exporter created above. Better to create resource first since it doesn't start any background work.
@@ -90,6 +85,11 @@ func (f *Factory) Initialize(metricsFactory metrics.Factory, logger *zap.Logger) | |||
default: | |||
return errors.New("kafka encoding is not one of '" + EncodingJSON + "' or '" + EncodingProto + "'") | |||
} | |||
p, err := f.NewProducer(logger) |
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.
producer starts bg activity so create it last
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
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #5026 +/- ##
==========================================
+ Coverage 95.61% 95.62% +0.01%
==========================================
Files 319 319
Lines 18786 18793 +7
==========================================
+ Hits 17962 17971 +9
+ Misses 661 660 -1
+ Partials 163 162 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Which problem is this PR solving?
Description of the changes
How was this change tested?