Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Gemfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ gem 'daemons', '= 1.2.4'
# Production gems
gem 'rake', '~> 13.0'
gem 'builder', '= 3.2.3'
gem 'redis', '= 4.1.1'
# Use a patched resque to allow reusing their Airbrake Failure class
gem 'resque', git: 'https://github.com/3scale/resque', branch: '3scale'
gem 'rack', '~> 2.0.8'
Expand All @@ -63,3 +62,8 @@ gem 'bugsnag', '~> 6', require: nil
gem 'yabeda-prometheus', '~> 0.5.0'
gem 'async-redis', '~> 0.4.1'
gem 'falcon', '~> 0.35'

# Use a patched redis-rb that fixes an issue when trying to connect with
# sentinels and avoids retrying calls when there's a timeout to prevent
# duplicated commands. It's based on version 4.1.3.
gem 'redis', git: 'https://github.com/3scale/redis-rb', branch: 'apisonator'
10 changes: 8 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ GIT
specs:
puma (2.15.3)

GIT
remote: https://github.com/3scale/redis-rb
revision: 35301b3d952975300a4cb30d408ae3b5969d0440
branch: apisonator
specs:
redis (4.1.3)

GIT
remote: https://github.com/3scale/resque
revision: 88839e71756ea9b6edfc9426a0af71e94109c135
Expand Down Expand Up @@ -182,7 +189,6 @@ GEM
rack-test (0.8.2)
rack (>= 1.0, < 3)
rake (13.0.1)
redis (4.1.1)
redis-namespace (1.6.0)
redis (>= 3.0.4)
reentrant_flock (0.1.1)
Expand Down Expand Up @@ -297,7 +303,7 @@ DEPENDENCIES
rack (~> 2.0.8)
rack-test (~> 0.8.2)
rake (~> 13.0)
redis (= 4.1.1)
redis!
resque!
resque_spec (~> 0.17.0)
resque_unit (~> 0.4.4)!
Expand Down
10 changes: 8 additions & 2 deletions Gemfile.on_prem.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ GIT
specs:
puma (2.15.3)

GIT
remote: https://github.com/3scale/redis-rb
revision: 35301b3d952975300a4cb30d408ae3b5969d0440
branch: apisonator
specs:
redis (4.1.3)

GIT
remote: https://github.com/3scale/resque
revision: 88839e71756ea9b6edfc9426a0af71e94109c135
Expand Down Expand Up @@ -170,7 +177,6 @@ GEM
rack-test (0.8.2)
rack (>= 1.0, < 3)
rake (13.0.1)
redis (4.1.1)
redis-namespace (1.6.0)
redis (>= 3.0.4)
reentrant_flock (0.1.1)
Expand Down Expand Up @@ -278,7 +284,7 @@ DEPENDENCIES
rack (~> 2.0.8)
rack-test (~> 0.8.2)
rake (~> 13.0)
redis (= 4.1.1)
redis!
resque!
resque_spec (~> 0.17.0)
resque_unit (~> 0.4.4)!
Expand Down
1 change: 0 additions & 1 deletion lib/3scale/backend.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
require 'hiredis'

require 'redis'
require '3scale/backend/extensions/redis'

require 'resque'
require 'securerandom'
Expand Down
44 changes: 0 additions & 44 deletions lib/3scale/backend/extensions/redis.rb

This file was deleted.

10 changes: 7 additions & 3 deletions lib/3scale/backend/storage_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,13 @@ class << self
connect_timeout: 5,
read_timeout: 3,
write_timeout: 3,
# this is set to zero to avoid potential double transactions
# see https://github.com/redis/redis-rb/issues/668
reconnect_attempts: 0,
# Note that we can set reconnect_attempts to >= 0 because we use
# our redis-rb fork which implements a workaround for this issue
# that shows that when there might be duplicated transactions when
# there's a timeout: https://github.com/redis/redis-rb/issues/668
# We should investigate if there are edge cases that can lead to
# duplicated commands because of this setting.
reconnect_attempts: 1,
# use by default the C extension client
driver: :hiredis
}.freeze
Expand Down