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 raised by plugin/storage/integration/cassandra_test.go #5311

Conversation

WillSewell
Copy link
Contributor

@WillSewell WillSewell commented Mar 29, 2024

Which problem is this PR solving?

Description of the changes

  • Fixes goroutine leaks in the shutdown of cassandra Factory
  • It does not add the goleak detection because there are still failures in this package related to other components (e.g. grpc, elasticsearch)

How was this change tested?

  • Add a goleak detection (i.e. this file 105a4d7)
  • STORAGE=cassandra go test -v ./plugin/storage/integration

Checklist

There doesn't seem to be any leaks detected for this package.

Signed-off-by: Will Sewell <[email protected]>
@WillSewell WillSewell requested a review from a team as a code owner March 29, 2024 14:37
@WillSewell WillSewell requested a review from joe-elliott March 29, 2024 14:37
@yurishkuro yurishkuro added the changelog:test Change that's adding missing tests or correcting existing tests label Mar 29, 2024
@yurishkuro yurishkuro enabled auto-merge (squash) March 29, 2024 15:36
@yurishkuro
Copy link
Member

I think make test lint doesn't actually run integration tests, so in real CI they are failing on leaks.

@WillSewell WillSewell marked this pull request as draft March 29, 2024 15:50
auto-merge was automatically disabled March 29, 2024 15:50

Pull request was converted to draft

@WillSewell WillSewell force-pushed the add-goleak-to-plugin-storage-integration branch from a17c814 to 55089ae Compare March 31, 2024 21:41
Copy link
Member

@yurishkuro yurishkuro left a comment

Choose a reason for hiding this comment

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

please rebase, lots of function signatures have changes

plugin/storage/integration/cassandra_test.go Outdated Show resolved Hide resolved
plugin/storage/integration/cassandra_test.go Outdated Show resolved Hide resolved
plugin/storage/cassandra/factory.go Outdated Show resolved Hide resolved
plugin/storage/cassandra/factory.go Show resolved Hide resolved
plugin/storage/integration/cassandra_test.go Outdated Show resolved Hide resolved
plugin/storage/integration/cassandra_test.go Outdated Show resolved Hide resolved
Will Sewell added 3 commits April 8, 2024 22:08
Signed-off-by: Will Sewell <[email protected]>
There are still a number of violations and I think it's more
important we prioritise getting the current fixes to
cassandra/factory.go rather than risk these not getting merged at
all while we are blocked on other violations in the package.

Signed-off-by: Will Sewell <[email protected]>
Copy link

codecov bot commented Apr 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.26%. Comparing base (f18416a) to head (0542a88).
Report is 14 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5311      +/-   ##
==========================================
+ Coverage   95.15%   95.26%   +0.11%     
==========================================
  Files         340      340              
  Lines       16666    16677      +11     
==========================================
+ Hits        15858    15888      +30     
+ Misses        617      600      -17     
+ Partials      191      189       -2     
Flag Coverage Δ
badger 11.18% <0.00%> (-1.08%) ⬇️
cassandra-3.x 19.57% <62.50%> (-1.57%) ⬇️
cassandra-4.x 19.57% <62.50%> (-1.57%) ⬇️
elasticsearch-5.x 22.19% <0.00%> (+4.49%) ⬆️
elasticsearch-6.x 22.18% <0.00%> (+4.48%) ⬆️
elasticsearch-7.x 22.25% <0.00%> (+4.49%) ⬆️
elasticsearch-8.x 22.45% <0.00%> (+4.61%) ⬆️
grpc 11.58% <0.00%> (-0.02%) ⬇️
kafka 10.80% <0.00%> (-1.05%) ⬇️
opensearch-1.x 22.30% <0.00%> (+4.53%) ⬆️
opensearch-2.x 22.29% <0.00%> (+4.52%) ⬆️
unittests 92.31% <100.00%> (-0.02%) ⬇️

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.

Will Sewell added 2 commits April 8, 2024 22:40
@@ -109,7 +112,7 @@ func (s *CassandraStorageIntegration) initializeDependencyReaderAndWriter(t *tes
}

func TestCassandraStorage(t *testing.T) {
skipUnlessEnv(t, "cassandra")
// skipUnlessEnv(t, "cassandra")
Copy link
Member

Choose a reason for hiding this comment

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

need to revert this

@WillSewell WillSewell changed the title Add goroutine leak checks to plugin/storage/integration Fix goroutine leaks raised by plugin/storage/integration/cassandra_test.go Apr 8, 2024
@WillSewell
Copy link
Contributor Author

@yurishkuro this has stalled because I got bogged down fixing various other goroutine leaks that goleak detects in this package.

I fixed the ones in the grpc tests, but lost momentum on the ones in the elasticsearch tests because at least one leak is actually originating in the github.com/olivere/elastic library.

So my thinking is rather than a single big PR that fixes all leaks (and risks not getting done at all), I'll instead aim to do some smaller PRs to cover the things I have managed to fixed. No guarantees whether I'll get to the elasticsearch fixes...

@yurishkuro
Copy link
Member

rather than a single big PR that fixes

yeah, you can stop this sentence here, I am always +1 to smaller PRs :-)

@yurishkuro yurishkuro marked this pull request as ready for review April 8, 2024 22:01
@yurishkuro yurishkuro merged commit 6a26005 into jaegertracing:main Apr 8, 2024
38 checks passed
@WillSewell WillSewell deleted the add-goleak-to-plugin-storage-integration branch April 8, 2024 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:test Change that's adding missing tests or correcting existing tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants