Skip to content

Commit

Permalink
leaktest: ignore pgconn leaked goroutines
Browse files Browse the repository at this point in the history
We see those in c2c unit tests when using pg connections between
the 2 clusters.

Note that we already ignored one of those stack traces here cockroachdb#102258
and then reverted that change: cockroachdb@8ecc8f6
but later we saw that we need to ignore both stacks because of cockroachdb#102672.

The first fix above was not enough, it was ignoring only one stack.

Epic: none

Fixes: cockroachdb#97698
Fixes: cockroachdb#97346
Fixes: cockroachdb#102672

Release note: None
  • Loading branch information
lidorcarmel committed May 1, 2023
1 parent c6d76de commit c2237f3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/util/leaktest/leaktest.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ func interestingGoroutines() map[int64]string {
strings.Contains(stack, "sentry-go.(*HTTPTransport).worker") ||
// Ignore the opensensus worker, which is created by the event exporter.
strings.Contains(stack, "go.opencensus.io/stats/view.(*worker).start") ||
// Ignore pgconn which creates a goroutine to do an async cleanup.
strings.Contains(stack, "github.com/jackc/pgconn.(*PgConn).asyncClose.func1") ||
// Ignore pgconn which creates a goroutine to watch context cancellation.
strings.Contains(stack, "github.com/jackc/pgconn/internal/ctxwatch.(*ContextWatcher).Watch.func1") ||
// Seems to be gccgo specific.
(runtime.Compiler == "gccgo" && strings.Contains(stack, "testing.T.Parallel")) ||
// Ignore intentionally long-running logging goroutines that live for the
Expand Down

0 comments on commit c2237f3

Please sign in to comment.