-
Notifications
You must be signed in to change notification settings - Fork 825
Open
Labels
good first issueThese are great first issues. If you are looking for a place to start, start here!These are great first issues. If you are looking for a place to start, start here!help wantedtype/tests
Description
Spent the morning debugging what I thought was a goroutine leak, but turned out to be just a huge number of goroutines being created in a short period of time. However, it seems a lot of the unit tests do leak goroutines. Most of these might just be issues with tests not cleaning up properly, but it makes testing/debugging real leaks quite difficult. Or in my case, the leaks were a red herring - the issue was something else.
Given we already have goleak vendored in presumably from Prometheus (they use it), it would be nice to start using it.
We leak ~2000 goroutines per full run of the unit tests. Summary below, full data here: unit-test-leaks.txt
top 5 leakers by package
928 pkg/distributor
224 pkg/ingester
147 pkg/chunk/storage
122 pkg/compactor
81 pkg/querier
top 5 leakers by func
1153 github.com/cortexproject/cortex/pkg/ring/kv/consul.(*mockKV).loop
109 internal/poll.runtime_pollWait
68 runtime.goparkunlock
65 github.com/prometheus/prometheus/tsdb/wal.(*WAL).run
62 google.golang.org/grpc.(*addrConn).resetTransport
(Changes used are here - stevesg@b0a95a2 )
Metadata
Metadata
Assignees
Labels
good first issueThese are great first issues. If you are looking for a place to start, start here!These are great first issues. If you are looking for a place to start, start here!help wantedtype/tests