Skip to content

Commit

Permalink
Properly release the ticker in Loki client. (#3566)
Browse files Browse the repository at this point in the history
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 <cyril.tovena@gmail.com>
(cherry picked from commit ecca5d3)
  • Loading branch information
cyriltovena authored and slim-bean committed Apr 6, 2021
1 parent b2aec4a commit e6bddfc
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkg/promtail/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e6bddfc

Please sign in to comment.