Report
pkg/scalers/splunk_observability_scaler.go Close() is return nil. NewSplunkObservabilityScaler creates a long-lived *signalflow.Client (websocket + several goroutines) and never closes it.
KEDA calls Scaler.Close() from ScalersCache.Close, refreshScaler, and the builder error path. Each close currently leaks the SignalFlow client until the operator process exits.
This is not a request to add a KEDA-owned reconnect/rebuild loop. signalflow-client-go/v2@v2.3.0 already reconnects (wsConn.Run, reconnectDelay = 5s). A local probe after KillExistingConnections() showed later getQueryResult calls succeeding on the same client (~8s then ~3s).
I want to implement Close() so it calls apiClient.Close() exactly once, serialize it against in-flight getQueryResult (library Close() + a later Execute panics with send on closed channel; a second Client.Close() panics with cannot close client more than once), and add unit tests for teardown + library reconnect.
Known leftover after a correct apiClient.Close(): one bufferMessages goroutine blocked sending on the unused Info channel (KEDA never reads comp.Info()). That is a library limitation; I am not proposing to drain Info/Events in this issue.
Expected Behavior
Scaler.Close() tears down the SignalFlow client. A second Close() is a no-op. getQueryResult after close returns an error, not a panic. A websocket drop does not permanently disable the scaler (library reconnect).
Actual Behavior
Close() is a no-op. After one query, 10 SignalFlow goroutines remain. They survive Close().
Steps to Reproduce the Problem
- Construct
splunkObservabilityScaler with signalflow.NewRunningFakeBackend().Client().
- Call
getQueryResult once.
- Count goroutines whose stacks contain
signalflow-client-go (0 before, 10 after).
- Call
Close().
- Count again — still 10.
Logs from KEDA operator
n/a — reproduced in unit tests against FakeBackend
KEDA Version
Other (main / current scaler as of 2026-08-29)
Kubernetes Version
Other
Platform
Any
Scaler Details
Splunk Observability (SignalFx)
Would you be open to contributing a fix?
Yes
Anything else?
Separate from #8097 / #8098 (aggregators). Please assign me if this is accepted and I will open one PR: implement Close(), lock it against queries, unit-test teardown + reconnect. No changelog (release notes are automated). No keda-docs change (not user-facing metadata).
Report
pkg/scalers/splunk_observability_scaler.goClose()isreturn nil.NewSplunkObservabilityScalercreates a long-lived*signalflow.Client(websocket + several goroutines) and never closes it.KEDA calls
Scaler.Close()fromScalersCache.Close,refreshScaler, and the builder error path. Each close currently leaks the SignalFlow client until the operator process exits.This is not a request to add a KEDA-owned reconnect/rebuild loop.
signalflow-client-go/v2@v2.3.0already reconnects (wsConn.Run,reconnectDelay = 5s). A local probe afterKillExistingConnections()showed latergetQueryResultcalls succeeding on the same client (~8s then ~3s).I want to implement
Close()so it callsapiClient.Close()exactly once, serialize it against in-flightgetQueryResult(libraryClose()+ a laterExecutepanics withsend on closed channel; a secondClient.Close()panics withcannot close client more than once), and add unit tests for teardown + library reconnect.Known leftover after a correct
apiClient.Close(): onebufferMessagesgoroutine blocked sending on the unused Info channel (KEDA never readscomp.Info()). That is a library limitation; I am not proposing to drain Info/Events in this issue.Expected Behavior
Scaler.Close()tears down the SignalFlow client. A secondClose()is a no-op.getQueryResultafter close returns an error, not a panic. A websocket drop does not permanently disable the scaler (library reconnect).Actual Behavior
Close()is a no-op. After one query, 10 SignalFlow goroutines remain. They surviveClose().Steps to Reproduce the Problem
splunkObservabilityScalerwithsignalflow.NewRunningFakeBackend().Client().getQueryResultonce.signalflow-client-go(0 before, 10 after).Close().Logs from KEDA operator
KEDA Version
Other (main / current scaler as of 2026-08-29)
Kubernetes Version
Other
Platform
Any
Scaler Details
Splunk Observability (SignalFx)
Would you be open to contributing a fix?
Yes
Anything else?
Separate from #8097 / #8098 (aggregators). Please assign me if this is accepted and I will open one PR: implement
Close(), lock it against queries, unit-test teardown + reconnect. No changelog (release notes are automated). No keda-docs change (not user-facing metadata).