From ae8d93814ce7bae3d4ccf67eadb1b3b6e63adb46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20Kj=C3=B6lhede?= Date: Fri, 13 Feb 2026 20:58:16 +0100 Subject: [PATCH] Fix missing ticker.Stop() in pollForSettingChanges The pollForSettingChanges function creates a ticker but never calls Stop() on it when the context is cancelled, leaking the ticker's internal runtime timer. Other functions in the same file (heartbeatLogLoop, reportQueueStatusLoop) correctly use defer ticker.Stop(). This aligns with that pattern. Note: pollForSettingChanges only runs when no notifier is configured (poll-only mode), so this only affects non-LISTEN/NOTIFY setups. Co-Authored-By: Claude Opus 4.6 --- producer.go | 1 + 1 file changed, 1 insertion(+) diff --git a/producer.go b/producer.go index 951c1b9d..8a68062a 100644 --- a/producer.go +++ b/producer.go @@ -857,6 +857,7 @@ func (p *producer) pollForSettingChanges(ctx context.Context, wg *sync.WaitGroup defer wg.Done() ticker := time.NewTicker(p.config.QueuePollInterval) + defer ticker.Stop() for { select { case <-ctx.Done():