Why is this an issue?
In internal/workers/lifecycle_worker.go:41-45, the startup goroutine does not call wg.Done(), causing a goroutine leak and incorrect wait group counting.
What is causing it?
wg.Add(1) // line 41
go func() {
defer wg.Done() // MISSING - no wg.Done() here
w.processRules(ctx)
}()
defer wg.Done() is missing inside the goroutine. Only defer wg.Done() in Run() exits when the main function exits, not when processRules completes.
How can it be solved?
Add defer wg.Done() inside the goroutine:
go func() {
defer wg.Done()
w.processRules(ctx)
}()
Category
Severity
Why is this an issue?
In
internal/workers/lifecycle_worker.go:41-45, the startup goroutine does not callwg.Done(), causing a goroutine leak and incorrect wait group counting.What is causing it?
defer wg.Done()is missing inside the goroutine. Onlydefer wg.Done()inRun()exits when the main function exits, not whenprocessRulescompletes.How can it be solved?
Add
defer wg.Done()inside the goroutine:Category
Severity