Skip to content
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

Merged
merged 3 commits into from
Dec 22, 2023

Conversation

yurishkuro
Copy link
Member

Which problem is this PR solving?

Description of the changes

  • Fix goroutine leaks in several packages

How was this change tested?

  • go test

Signed-off-by: Yuri Shkuro <github@ysh.us>
Signed-off-by: Yuri Shkuro <github@ysh.us>
@yurishkuro yurishkuro added the changelog:ci Change related to continuous integration / testing label Dec 22, 2023
@yurishkuro yurishkuro requested a review from a team as a code owner December 22, 2023 02:04
@@ -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
Copy link
Member Author

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)
Copy link
Member Author

@yurishkuro yurishkuro Dec 22, 2023

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

@yurishkuro
Copy link
Member Author

cc @akagami-harsh

Copy link
Contributor

@jkowall jkowall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@yurishkuro yurishkuro enabled auto-merge (squash) December 22, 2023 15:20
Copy link

codecov bot commented Dec 22, 2023

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (baed450) 95.61% compared to head (34cc741) 95.62%.

Files Patch % Lines
plugin/storage/es/factory.go 66.66% 1 Missing and 1 partial ⚠️
pkg/es/wrapper/wrapper.go 0.00% 1 Missing ⚠️
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     
Flag Coverage Δ
cassandra-3.x 25.61% <0.00%> (-0.03%) ⬇️
cassandra-4.x 25.61% <0.00%> (-0.03%) ⬇️
elasticsearch-5.x 19.87% <0.00%> (-0.04%) ⬇️
elasticsearch-6.x 19.87% <0.00%> (-0.04%) ⬇️
elasticsearch-7.x 20.00% <0.00%> (-0.04%) ⬇️
elasticsearch-8.x 20.11% <0.00%> (-0.02%) ⬇️
grpc-badger 19.51% <0.00%> (-0.03%) ⬇️
kafka 14.10% <16.66%> (-0.02%) ⬇️
opensearch-1.x 20.02% <0.00%> (-0.01%) ⬇️
opensearch-2.x 20.00% <0.00%> (-0.04%) ⬇️
unittests 93.36% <86.36%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@yurishkuro yurishkuro merged commit db20c5b into jaegertracing:main Dec 22, 2023
36 of 37 checks passed
@yurishkuro yurishkuro deleted the no-goleak branch December 22, 2023 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:ci Change related to continuous integration / testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants