In this article
Stopping a ticker does not close its channel; Loki 3.7.10 adds the lifecycle handling needed to stop ingester autoforget work.
Loki 3.7.10 ties the ingester autoforget goroutine to the service lifecycle. The old loop could outlive the ingester and repeatedly contact a terminated memberlist key-value service. PR 25730 explains the subtle channel rule behind the leak: stopping a ticker does not close its channel, so ranging over that channel does not terminate. Service shutdown therefore needs explicit cancellation rather than an assumption about timer cleanup.
Timer cleanup and goroutine completion differ
The PR describes a loop using for range ticker.C with no stop condition. Calling ticker.Stop prevents future ticks but does not give the receiver an end-of-channel event. A proposed regression check starts the ingester, activates autoforget and stops the service while leaving the process alive. Killing the whole process would remove the leaked goroutine by force and conceal whether service-level shutdown actually worked. The intended assertion is goroutine completion at the service boundary.
A stopped dependency can still receive calls
Upstream reports repeated attempts against a terminated memberlist KV after ingester stop, producing unexpected-state warnings. That symptom can look like a memberlist failure even though the caller should already have exited. A diagnostic record should correlate the ingester service transition with subsequent autoforget calls. The release does not claim that every terminated-state warning has this cause; the component and timing relationship are what make this particular explanation applicable.
Exercise repeated component lifetimes
A proposed qualification can repeat service construction and stop within one process and inspect whether background work accumulates. This stresses the lifecycle ownership more directly than a single full binary exit. Keep the number of component lifetimes explicit and compare observed goroutines or callbacks with that sequence. The PR does not provide a resource-growth benchmark, so any measured memory or warning-volume change belongs to the local experiment and its chosen workload.
Do not disable healthy autoforget behavior
A fix that never starts autoforget would also eliminate post-stop calls while losing the intended running-service function. Include a positive check that expected work occurs before stop, then ceases afterward. The release’s contribution is correct ownership and termination of background activity. It does not change the meaning of forgetting members or prove that all ingester shutdown paths are now bounded; other lifecycle dependencies need their own verification.
Sources
- grafana/loki v3.7.10 release notes
- fix(ingester): Stop the autoforget goroutine when the ingester stops [release-3.7.x] by jnewbigin
Related reading
Earn rental income from GPUs
Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.