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

[chore][awscloudwatchlogsexporter] Enable goleak check #30744

Conversation

crobert-1
Copy link
Member

Description:

Enables goleak checking on the awscloudwatchlogsexporter package. This is purely a testing update.

Marking this PR as a draft as this check has failed in the past in CI (passing locally), so I'll investigate when it fails again.

Link to tracking Issue:
#30438

Testing:
All tests are passing, as well as new goleak check.

@github-actions github-actions bot added the exporter/awscloudwatchlogs awscloudwatchlogs exporter label Jan 24, 2024
@crobert-1
Copy link
Member Author

Since I can't reproduce locally, I'm having trouble finding where the goroutine is being started in tests. From what I can tell, the calls that would create goroutines are mocked for testing, so no goroutines are being started. I'll come back to this to investigate eventually, but closing for now.

Here's the stack for when the CI action is no longer stored:

goleak: Errors on successful test run: found unexpected goroutines:
[Goroutine 72 in state IO wait, with internal/poll.runtime_pollWait on top of the stack:
internal/poll.runtime_pollWait(0x7f81163c4ee0, 0x72)
	/opt/hostedtoolcache/go/1.21.5/x64/src/runtime/netpoll.go:343 +0x85
internal/poll.(*pollDesc).wait(0xc0001b9220, 0xc00023a000?, 0x0)
	/opt/hostedtoolcache/go/1.21.5/x64/src/internal/poll/fd_poll_runtime.go:84 +0xb1
internal/poll.(*pollDesc).waitRead(...)
	/opt/hostedtoolcache/go/1.21.5/x64/src/internal/poll/fd_poll_runtime.go:89
internal/poll.(*FD).Read(0xc0001b9200, {0xc00023a000, 0x1000, 0x1000})
	/opt/hostedtoolcache/go/1.21.5/x64/src/internal/poll/fd_unix.go:164 +0x[40](https://github.com/open-telemetry/opentelemetry-collector-contrib/actions/runs/7633684862/job/20796454027?pr=30744#step:8:41)5
net.(*netFD).Read(0xc0001b9200, {0xc00023a000, 0x1000, 0x1000})
	/opt/hostedtoolcache/go/1.21.5/x64/src/net/fd_posix.go:55 +0x4b
net.(*conn).Read(0xc00006[41](https://github.com/open-telemetry/opentelemetry-collector-contrib/actions/runs/7633684862/job/20796454027?pr=30744#step:8:42)a0, {0xc00023a000, 0x1000, 0x1000})
	/opt/hostedtoolcache/go/1.21.5/x64/src/net/net.go:179 +0xad
net/http.(*persistConn).Read(0xc000710b40, {0xc00023a000, 0x1000, 0x1000})
	/opt/hostedtoolcache/go/1.21.5/x64/src/net/http/transport.go:1954 +0x105
bufio.(*Reader).fill(0xc0004fa600)
	/opt/hostedtoolcache/go/1.21.5/x64/src/bufio/bufio.go:113 +0x29a
bufio.(*Reader).Peek(0xc0004fa600, 0x1)
	/opt/hostedtoolcache/go/1.21.5/x64/src/bufio/bufio.go:151 +0xc7
net/http.(*persistConn).readLoop(0xc000710b40)
	/opt/hostedtoolcache/go/1.21.5/x64/src/net/http/transport.go:2118 +0x354
created by net/http.(*Transport).dialConn in goroutine 70
	/opt/hostedtoolcache/go/1.21.5/x64/src/net/http/transport.go:1776 +0x25da
 Goroutine 73 in state select, with net/http.(*persistConn).writeLoop on top of the stack:
net/http.(*persistConn).writeLoop(0xc000710b40)
	/opt/hostedtoolcache/go/1.21.5/x64/src/net/http/transport.go:2[42](https://github.com/open-telemetry/opentelemetry-collector-contrib/actions/runs/7633684862/job/20796454027?pr=30744#step:8:43)1 +0x1bc
created by net/http.(*Transport).dialConn in goroutine 70
	/opt/hostedtoolcache/go/1.21.5/x64/src/net/http/transport.go:1777 +0x266b
]
FAIL	github.com/open-telemetry/opentelemetry-collector-contrib/exporter/awscloudwatchlogsexporter	0.[51](https://github.com/open-telemetry/opentelemetry-collector-contrib/actions/runs/7633684862/job/20796454027?pr=30744#step:8:52)2s
FAIL
make[2]: *** [../../Makefile.Common:120: test] Error 1
make[2]: Leaving directory '/home/runner/work/opentelemetry-collector-contrib/opentelemetry-collector-contrib/exporter/awscloudwatchlogsexporter'
make[1]: *** [Makefile:1[52](https://github.com/open-telemetry/opentelemetry-collector-contrib/actions/runs/7633684862/job/20796454027?pr=30744#step:8:53): exporter/awscloudwatchlogsexporter] Error 2
make[1]: Leaving directory '/home/runner/work/opentelemetry-collector-contrib/opentelemetry-collector-contrib'
make: *** [Makefile:104: gotest] Error 2
Error: Process completed with exit code 2.

dialConn is usually called in this stack, but it's hard to track down through AWS dependencies:

http.(*Transport).queueForDial (transport.go:1436) net/http
http.(*Transport).getConn (transport.go:1390) net/http
http.(*Transport).roundTrip (transport.go:591) net/http
http.(*Transport).RoundTrip (roundtrip.go:17) net/http
http.send (client.go:260) net/http
http.(*Client).send (client.go:181) net/http
http.(*Client).do (client.go:724) net/http
http.(*Client).Do (client.go:590) net/http

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exporter/awscloudwatchlogs awscloudwatchlogs exporter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant