From ab74a50d857c6a0ac7e5c11f9d8ddd12ee5e1805 Mon Sep 17 00:00:00 2001 From: Krzysztof Kotlarek Date: Thu, 17 Oct 2019 08:49:23 +1100 Subject: [PATCH] FIX: update Redis gem to version 4.1.3 (#8197) * FIX: update Redis gem to version 4.1.3 I run our benchmark on commit with hiredis and redis-4.1.3 Results: type | hidredis | redis 4.1.3 | percent --- | --- | --- | --- Categories-50 | 49 | 50 | 102.04% Categories-75 | 51 | 51 | 100.00% Categories-90 | 63 | 64 | 101.59% Categories-99 | 86 | 85 | 98.84% Home-50 | 55 | 55 | 100.00% Home-75 | 56 | 57 | 101.79% Home-90 | 68 | 69 | 101.47% Home-99 | 102 | 104 | 101.96% Topic-50 | 36 | 37 | 102.78% Topic-75 | 37 | 37 | 100.00% Topic-90 | 47 | 48 | 102.13% Topic-99 | 60 | 61 | 101.67% Categories-admin-50 | 124 | 117 | 94.35% Categories-admin-75 | 130 | 129 | 99.23% Categories-admin-90 | 147 | 143 | 97.28% Categories-admin-99 | 204 | 199 | 97.55% Home-admin-50 | 146 | 148 | 101.37% Home-admin-75 | 150 | 152 | 101.33% Home-admin-90 | 169 | 168 | 99.41% Home-admin-99 | 232 | 223 | 96.12% Topic-admin-50 | 60 | 61 | 101.67% Topic-admin-75 | 64 | 63 | 98.44% Topic-admin-90 | 76 | 73 | 96.05% Topic-admin-99 | 124 | 94 | 75.81% Load rails | 2412 | 2360 | 97.84% rss | 290204 | 295828 | 101.94% pss | 277948 | 283624 | 102.04% * FIX: get rid of redis freedom patch --- Gemfile | 9 +-------- Gemfile.lock | 4 ++-- config/application.rb | 1 - lib/freedom_patches/redis.rb | 16 ---------------- 4 files changed, 3 insertions(+), 27 deletions(-) delete mode 100644 lib/freedom_patches/redis.rb diff --git a/Gemfile b/Gemfile index d523170a4ed..8f032801eba 100644 --- a/Gemfile +++ b/Gemfile @@ -36,14 +36,7 @@ gem 'mail', require: false gem 'mini_mime' gem 'mini_suffix' -# holding off redis upgrade temporarily as it is having issues with our current -# freedom patch, we will follow this up. -# -# FrozenError: can't modify frozen Hash -# /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/redis-4.1.0/lib/redis/client.rb:93:in `delete' -# /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/redis-4.1.0/lib/redis/client.rb:93:in `initialize' -# /var/www/discourse/lib/freedom_patches/redis.rb:7:in `initialize' -gem 'redis', '4.0.1' +gem 'redis', '4.1.3' gem 'redis-namespace' gem 'active_model_serializers', '~> 0.8.3' diff --git a/Gemfile.lock b/Gemfile.lock index d54d718a123..bd215e663e0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -309,7 +309,7 @@ GEM msgpack (>= 0.4.3) optimist (>= 3.0.0) rchardet (1.8.0) - redis (4.0.1) + redis (4.1.3) redis-namespace (1.6.0) redis (>= 3.0.4) request_store (1.4.1) @@ -516,7 +516,7 @@ DEPENDENCIES rb-inotify (~> 0.9) rbtrace rchardet - redis (= 4.0.1) + redis (= 4.1.3) redis-namespace rinku rotp diff --git a/config/application.rb b/config/application.rb index dd56bf859fe..a8f2fcc98fa 100644 --- a/config/application.rb +++ b/config/application.rb @@ -241,7 +241,6 @@ module Discourse require 'discourse_redis' require 'logster/redis_store' - require 'freedom_patches/redis' # Use redis for our cache config.cache_store = DiscourseRedis.new_redis_store $redis = DiscourseRedis.new diff --git a/lib/freedom_patches/redis.rb b/lib/freedom_patches/redis.rb deleted file mode 100644 index 8945ece473e..00000000000 --- a/lib/freedom_patches/redis.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -# https://github.com/redis/redis-rb/pull/591 -class Redis - class Client - alias_method :old_initialize, :initialize - - def initialize(options = {}) - old_initialize(options) - - if options.include?(:connector) && options[:connector].is_a?(Class) - @connector = options[:connector].new(@options) - end - end - end -end