FIX: redis leak when visiting large amounts of topics

FIX: redis leak when visiting large amounts of topics

Message bus uses a key to keep track of the last id for each channel
this key was never expired even if channel data expired

This change ensures we also expire the tracking key, it means a lot to us
cause each topic has a channel, so if you have 1 million topics that is
1 million keys that may persist forever

From 8868cfd2e412c95dfb7dc5d24a25f21ca817eee1 Mon Sep 17 00:00:00 2001
From: Sam <sam.saffron@gmail.com>
Date: Fri, 30 Nov 2018 14:41:15 +1100
Subject: [PATCH] FIX: redis leak when visiting large amounts of topics

Message bus uses a key to keep track of the last id for each channel
this key was never expired even if channel data expired

This change ensures we also expire the tracking key, it means a lot to us
cause each topic has a channel, so if you have 1 million topics that is
1 million keys that may persist forever

diff --git a/Gemfile b/Gemfile
index f91aeca..792a11c 100644
--- a/Gemfile
+++ b/Gemfile
@@ -43,7 +43,12 @@ gem 'ember-source', '2.13.3'
 gem 'ember-handlebars-template', '0.7.5'
 gem 'barber'
 
-gem 'message_bus'
+# message bus 2.2.0 should be very stable
+# we trimmed some of the internal API surface down so we went with
+# a pre release here to make we don't do a full release prior to
+# baking here. Remove 2.2.0.pre no later than Jan 2019 and move back
+# to the standard releases
+gem 'message_bus', '2.2.0.pre.1'
 
 gem 'rails_multisite'
 
diff --git a/Gemfile.lock b/Gemfile.lock
index 22551fd..daefc70 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -193,7 +193,7 @@ GEM
       mini_mime (>= 0.1.1)
     maxminddb (0.1.21)
     memory_profiler (0.9.12)
-    message_bus (2.1.6)
+    message_bus (2.2.0.pre.1)
       rack (>= 1.1.3)
     metaclass (0.0.4)
     method_source (0.8.2)
@@ -491,7 +491,7 @@ DEPENDENCIES
   mail (= 2.7.1.rc1)
   maxminddb
   memory_profiler
-  message_bus
+  message_bus (= 2.2.0.pre.1)
   mini_mime
   mini_racer
   mini_scheduler

GitHub

1 Like