Skip to content

Collector shutdown leaks a goroutine #8945

@jskiba

Description

@jskiba

Describe the bug
Otel Collector shutdown leaves a leaking goroutine
reproduced here: https://github.com/jskiba/opentelemetry-collector/blob/main/cmd/otelcorecol/main_test.go

=== RUN   TestCollector_Shutdown
    main_test.go:23: found unexpected goroutines:
        [Goroutine 19 in state select, with go.opencensus.io/stats/view.(*worker).start on top of the stack:
        go.opencensus.io/stats/view.(*worker).start(0xc0001d3400)
        	/Users/jakub.skiba/go/pkg/mod/[email protected]/stats/view/worker.go:292 +0x9f
        created by go.opencensus.io/stats/view.init.0 in goroutine 1
        	/Users/jakub.skiba/go/pkg/mod/[email protected]/stats/view/worker.go:34 +0x8d
        ]
--- FAIL: TestCollector_Shutdown (0.44s)

I haven't investigated that but opencensus seems to be archived so if it is not a bug in otel collector then it might be problematic.

Steps to reproduce
https://github.com/jskiba/opentelemetry-collector/blob/main/cmd/otelcorecol/main_test.go

What did you expect to see?
No leaking goroutines

What did you see instead?
Leaking goroutine

What version did you use?
Version: abdeacb

What config did you use?
Config: nono
It reproduces every time. The config does not matter here.

Environment
OS: macOS Sonoma 14.1.1
Compiler: go 1.21.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions