chore(release): v0.1.12 - #522
Conversation
| func (c *KedaScalerMetricsCollector) Stop() error { | ||
| c.mu.Lock() | ||
| defer c.mu.Unlock() | ||
|
|
||
| select { | ||
| case <-c.stopCh: | ||
| // already closed | ||
| default: | ||
| close(c.stopCh) | ||
| } | ||
| return nil | ||
| } | ||
|
|
||
| // GetResourceChannel returns the (unused) resource channel. | ||
| // This collector emits data directly via the sender rather than through the |
There was a problem hiding this comment.
⚠️ Bug: KEDA collector Stop never closes resourceChan, leaking processor goroutine
KedaScalerMetricsCollector.Stop() closes stopCh but never closes resourceChan (keda_scaler_metrics_collector.go:178-189). The manager's processCollectorChannel goroutine drives for resources := range resourceChan (manager.go:453) and only exits when the channel is closed. Since this collector emits directly via sender.SendScalerMetrics and never writes to or closes resourceChan, its processor goroutine blocks forever after Stop — leaking one goroutine on every selective restart (restartCollectors rebuilds the KEDA collector whenever KEDA_METRICS_ENDPOINT changes) and forcing the manager's shutdown to hit its per-collector and 10s wg.Wait() timeouts each time. Unlike ScaledObjectCollector, which closes batchChan so the batcher closes resourceChan, this collector has no batcher. Fix: close resourceChan in Stop (guarded so it runs once), or close it from the Start goroutine's defer when the loop exits.
Close resourceChan alongside stopCh so the manager's channel processor goroutine terminates.:
func (c *KedaScalerMetricsCollector) Stop() error {
c.mu.Lock()
defer c.mu.Unlock()
select {
case <-c.stopCh:
// already closed
default:
close(c.stopCh)
// Close the (unused) resource channel so the manager's
// processCollectorChannel range loop exits instead of leaking.
close(c.resourceChan)
}
return nil
}
- Apply fix
Check the box to apply the fix or reply for a change | Was this helpful? React with 👍 / 👎
Code Review
|
| if err == nil && pool.AppendCertsFromPEM(caData) { | ||
| tlsConfig.RootCAs = pool | ||
| } else { | ||
| tlsConfig.InsecureSkipVerify = true //nolint:gosec // see schedulerMetricsCAFileEnv doc comment. |
| tlsConfig.InsecureSkipVerify = true //nolint:gosec // see schedulerMetricsCAFileEnv doc comment. | ||
| } | ||
| } else { | ||
| tlsConfig.InsecureSkipVerify = true //nolint:gosec // see schedulerMetricsCAFileEnv doc comment. |
Release v0.1.12 of zxporter, published from the internal services monorepo.
The
v0.1.12tag has already been created and points at this branch's tip — ArgoCD and other tag consumers can use it immediately. This PR is only to advance public main to the released commit for browser convenience.Summary by Gitar
SchedulerMetricsCollectorto scrapedz-schedulerleader placement metricsKedaScalerMetricsCollectorto collect KEDA operator scaler metricsredmetricsaggregator for service-level RED telemetry via eBPF socket probesThis will update automatically on new commits.