From 06a71c7445d6ee35d0cb66dcc6dba94edf043667 Mon Sep 17 00:00:00 2001 From: Rikard Anglerud Date: Wed, 25 Jul 2018 18:36:18 +0100 Subject: [PATCH] GODRIVER-508 - call Stop() on heartbeatTicker and rateLimitr This should fix a memory leak in topology.Server's update() --- core/topology/server.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/topology/server.go b/core/topology/server.go index 50e73ed26e..c98aa6d4b4 100644 --- a/core/topology/server.go +++ b/core/topology/server.go @@ -251,6 +251,8 @@ func (s *Server) update() { defer s.closewg.Done() heartbeatTicker := time.NewTicker(s.cfg.heartbeatInterval) rateLimiter := time.NewTicker(minHeartbeatInterval) + defer heartbeatTicker.Stop() + defer rateLimiter.Stop() checkNow := s.checkNow done := s.done