Skip to content

Commit

Permalink
fix redis check memory leak (fixes #325)
Browse files Browse the repository at this point in the history
Since tags is a reference to a list, and we're appending tags to the list,
we keep adding the same tags over and over again, and the aggregator thinks
they're separate contexts, so it keeps creating new aggregation buffers for
them. Fix is to dedupe tags in the redis check
  • Loading branch information
Carlo Cabanilla committed Jan 2, 2013
1 parent f041630 commit d51c3a1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions checks.d/redisdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,9 @@ def _get_conn(self, host, port, password):

def _check_db(self, host, port, password, custom_tags=None):
conn = self._get_conn(host, port, password)
tags = custom_tags or []
tags += ["redis_host:%s" % host, "redis_port:%s" % port]
tags = set(custom_tags or [])
tags = sorted(tags.union(["redis_host:%s" % host,
"redis_port:%s" % port]))

# Ping the database for info, and track the latency.
start = time.time()
Expand Down

0 comments on commit d51c3a1

Please # to comment.