Splunk Observability scaler retains SignalFlow buffer goroutines across repeated queries
Report
PR #8134 fixes the SignalFlow client lifecycle problem reported in #8099. Testing its merge commit (0a7815a08da9d139098441db14e2e0ec494aa81f) confirms that client file descriptors now remain bounded.
However, repeated Splunk Observability queries still retain goroutines and heap memory.
This appears to be the known residual mentioned in #8099:
- Every SignalFlow
Computationstarts buffered forwarders for Data, Expirations, Events, and Info. - KEDA's
stopAndDrain()consumes onlycomp.Data(). - During shutdown,
bufferMessagesattempts to flush pending messages to its output channel. - If an output such as
comp.Info()has no consumer, that goroutine can remain blocked indefinitely.
A production-like soak with 18 Splunk Observability triggers polling every 15 or 30 seconds produced:
| Soak point | Working set | RSS | Heap in-use | Goroutines | Open FDs |
|---|---|---|---|---|---|
| +1 hour | 421 MiB | 503 MiB | 318 MiB | 3,200 | 185 |
| +16h 7m | 1,245 MiB | 1,326 MiB | 1,082 MiB | 36,102 | 183 |
| +17h 24m | 1,259 MiB | 1,340 MiB | 1,065 MiB | 37,489 | 183 |
The patched build had no restarts or OOMs during this period. FDs stayed flat, showing that #8134 materially improves the original client/socket leak, but goroutines continued growing by roughly 35 per minute and retained memory grew by approximately 51–55 MiB per hour.
The nominal workload creates roughly 50 Splunk query computations per minute, which is the same order as the observed goroutine growth.
Expected Behavior
Once a query computation completes or is canceled, all of its forwarding goroutines should terminate.
Under a fixed polling workload, goroutine count and retained heap should reach a bounded steady state.
Actual Behavior
File descriptors remain bounded after #8134, but goroutines and retained heap continue accumulating across repeated query computations.
The behavior is consistent with one unread SignalFlow buffer goroutine being retained for each computation.
Steps to Reproduce the Problem
- Check out commit
0a7815a08da9d139098441db14e2e0ec494aa81f. - Use the SignalFlow fake backend setup from
TestSplunkObservabilityCloseReapsClientGoroutines. - Call
getQueryResultrepeatedly on the same scaler, for example 50–100 times. - Allow each query's cancellation and cleanup to complete.
- Count goroutine stacks containing
signalflow-client-goorbufferMessagesafter each iteration. - Observe that the count grows with the number of computations instead of remaining bounded.
The existing single-query regression test permits before + 1 SignalFlow goroutine. It therefore does not detect linear accumulation across repeated queries.
Logs from KEDA operator
No crash log. The operator remained Running with zero restarts or OOMs
during the patched soak. A live pprof endpoint was not exposed.KEDA Version
Other (0a7815a08da9d139098441db14e2e0ec494aa81f, merge commit of #8134)
Platform
Any
Scaler Details
Splunk Observability (SignalFx)
Would you be open to contributing a fix?
Maybe
Anything else?
Potential fixes include:
- Consume
comp.Info(),comp.Events(), andcomp.Expirations()concurrently for the computation lifetime; or - Change
signalflow-client-goso shutdown cannot block while flushing to an unconsumed output channel.
A regression test should execute many queries and assert that the remaining SignalFlow goroutine count is bounded rather than allowing one additional goroutine per query.
Relevant references:
- #8099
- #8134
- KEDA scaler at the tested commit: https://github.com/kedacore/keda/blob/0a7815a08da9d139098441db14e2e0ec494aa81f/pkg/scalers/splunk_observability_scaler.go
- SignalFlow computation buffering: https://github.com/signalfx/signalflow-client-go/blob/v2.3.0/signalflow/computation.go
Source: kedacore/keda