Skip to content

Commit

Permalink
GODRIVER-508 - call Stop() on heartbeatTicker and rateLimitr
Browse files Browse the repository at this point in the history
This should fix a memory leak in topology.Server's update()
  • Loading branch information
Rikard Anglerud authored and Rikard Anglerud committed Jul 25, 2018
1 parent eecffe0 commit 06a71c7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/topology/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 06a71c7

Please sign in to comment.