From ecca5d345c7c3c6d06572d019d8dd5d7cbefc46c Mon Sep 17 00:00:00 2001 From: Cyril Tovena Date: Wed, 31 Mar 2021 16:40:23 -0400 Subject: [PATCH] Properly release the ticker in Loki client. (#3566) I think this was only impacting the docker driver who would start/stop for each new followed containers. My assumption is that this would slowly build up and eat CPU over time. Fixes #3319 I arrived to this conclusion since strace was showing a crazy amount of futex syscall and nothing else seems to be the cause. :pray: Signed-off-by: Cyril Tovena --- pkg/promtail/client/client.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/promtail/client/client.go b/pkg/promtail/client/client.go index 19c4a2da48a22..2dbe134f1d8c2 100644 --- a/pkg/promtail/client/client.go +++ b/pkg/promtail/client/client.go @@ -217,6 +217,7 @@ func (c *client) run() { maxWaitCheck := time.NewTicker(maxWaitCheckFrequency) defer func() { + maxWaitCheck.Stop() // Send all pending batches for tenantID, batch := range batches { c.sendBatch(tenantID, batch)