Skip to content

test flake: enterprise/tailnet: goroutine leakl: mappingQuery #11078

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

Closed
johnstcn opened this issue Dec 7, 2023 · 0 comments · Fixed by #11082
Closed

test flake: enterprise/tailnet: goroutine leakl: mappingQuery #11078

johnstcn opened this issue Dec 7, 2023 · 0 comments · Fixed by #11082
Assignees

Comments

@johnstcn
Copy link
Member

johnstcn commented Dec 7, 2023

Seen here: https://github.com/coder/coder/actions/runs/7127968542/job/19409011976

=== Failed
=== FAIL: enterprise/tailnet  (0.00s)
PASS
goleak: Errors on successful test run: found unexpected goroutines:
[Goroutine 348 in state chan send, with github.com/coder/coder/v2/enterprise/tailnet.(*querier).mappingQuery on top of the stack:
goroutine 348 [chan send]:
github.com/coder/coder/v2/enterprise/tailnet.(*querier).mappingQuery(0xc000576fc0, {0xd9, 0xfe, 0x51, 0x9f, 0xf9, 0x9d, 0x45, 0x44, 0x8a, ...})
	/home/runner/actions-runner/_work/coder/coder/enterprise/tailnet/pgcoord.go:944 +0x805
github.com/coder/coder/v2/enterprise/tailnet.(*querier).query(0xc000f15da0?, {{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...}, ...})
	/home/runner/actions-runner/_work/coder/coder/enterprise/tailnet/pgcoord.go:892 +0x6c
github.com/coder/coder/v2/enterprise/tailnet.(*querier).worker.func1()
	/home/runner/actions-runner/_work/coder/coder/enterprise/tailnet/pgcoord.go:881 +0x2e
github.com/cenkalti/backoff/v4.RetryNotifyWithTimer.func1()
	/home/runner/go/pkg/mod/github.com/cenkalti/backoff/v4@v4.2.1/retry.go:18 +0x1b
github.com/cenkalti/backoff/v4.doRetryNotify[...](0xc000e63ed8?, {0x7f7c589ecfc8, 0xc000a42120}, 0x0, {0x0, 0x0?})
	/home/runner/go/pkg/mod/github.com/cenkalti/backoff/v4@v4.2.1/retry.go:88 +0x152
github.com/cenkalti/backoff/v4.RetryNotifyWithTimer(0x0?, {0x7f7c589ecfc8?, 0xc000a42120?}, 0x12952a2e634bfc8a?, {0x0?, 0x0?})
	/home/runner/go/pkg/mod/github.com/cenkalti/backoff/v4@v4.2.1/retry.go:61 +0x65
github.com/cenkalti/backoff/v4.RetryNotify(...)
	/home/runner/go/pkg/mod/github.com/cenkalti/backoff/v4@v4.2.1/retry.go:49
github.com/cenkalti/backoff/v4.Retry(...)
	/home/runner/go/pkg/mod/github.com/cenkalti/backoff/v4@v4.2.1/retry.go:38
github.com/coder/coder/v2/enterprise/tailnet.(*querier).worker(0xc000576fc0)
	/home/runner/actions-runner/_work/coder/coder/enterprise/tailnet/pgcoord.go:880 +0x1f0
created by github.com/coder/coder/v2/enterprise/tailnet.newQuerier.func1
	/home/runner/actions-runner/_work/coder/coder/enterprise/tailnet/pgcoord.go:797 +0x7f
]
FAIL	github.com/coder/coder/v2/enterprise/tailnet	13.102s

It looks like worker() may need to have a lifecycle context plumbed through so it can shut down properly when the coordinator is closed.

@johnstcn johnstcn added the flake label Dec 7, 2023
@cdr-bot cdr-bot bot added the chore label Dec 7, 2023
@spikecurtis spikecurtis self-assigned this Dec 7, 2023
@spikecurtis spikecurtis added bug and removed chore labels Dec 7, 2023
spikecurtis added a commit that referenced this issue Dec 7, 2023
Fixes #11078

replace bare channel send with SendCtx so that we properly shut down when context is canceled.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants