apisonator 2.100.0 → 2.100.1.pre1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '02689c2d07caa6e88eb1079c13064378fafa921ffb28e4da095cd8ad5fbac578'
4
- data.tar.gz: 434d69fc1eb06088b1c4111bd41979567f1b00c22b149e5b4a7bdbda48c447a1
3
+ metadata.gz: dae3de8eebce04d8b04a021fec76abb818d1cd822cbc694b68b4d871dfc9fd3a
4
+ data.tar.gz: c333324eac2bcb8b4cc8bc2a098a8d8ad6e646ddb1f013788b18a9662369f7c2
5
5
  SHA512:
6
- metadata.gz: edc21e4dedc90447e734e7afe0fe681127d9a4a88cd4ba3d9f9633b7eae3ee31488aa54b9cfaaeb6e28c158eb822c9679e325c4b6773130779fd63f5a6498fe9
7
- data.tar.gz: 3267cfad364babfafb0c563feea99ecd0ff346b7a12d224b37178ff28e13a92fcce8a25372b1901f54a1bfcf6ecdeea0f9665ac2e30dcc6fe0fa3aff15bce468
6
+ metadata.gz: c5ac555a4aa397ae529ce15788f045319fc816a22841eb04e8f07111291eee560b6ebd45641b93233c1e6e0044561e4bec10889678452e66123e8a977d29ffb1
7
+ data.tar.gz: 602aa508a6d4506bb15dfe200936b2455dc5acbaa3990c6f45fa0c7a9c4d59ab172758d44d6f91a679548e7a2127f61f6482b40dc0002e9d18a4da2ba8db2753
@@ -9,7 +9,7 @@ gemspec
9
9
  # implementations (ie. pure Ruby, java, etc).
10
10
  #
11
11
  platform :ruby do
12
- gem 'hiredis', '= 0.6.1'
12
+ gem 'hiredis', '~> 0.6.1'
13
13
  gem 'yajl-ruby', '~> 1.3.1', require: 'yajl'
14
14
  gem 'pry-byebug', '~> 3.5.1', groups: [:development]
15
15
  end
@@ -52,7 +52,6 @@ gem 'daemons', '= 1.2.4'
52
52
  # Production gems
53
53
  gem 'rake', '~> 13.0'
54
54
  gem 'builder', '= 3.2.3'
55
- gem 'redis', '= 4.1.1'
56
55
  # Use a patched resque to allow reusing their Airbrake Failure class
57
56
  gem 'resque', git: 'https://github.com/3scale/resque', branch: '3scale'
58
57
  gem 'rack', '~> 2.0.8'
@@ -63,3 +62,8 @@ gem 'bugsnag', '~> 6', require: nil
63
62
  gem 'yabeda-prometheus', '~> 0.5.0'
64
63
  gem 'async-redis', '~> 0.4.1'
65
64
  gem 'falcon', '~> 0.35'
65
+
66
+ # Use a patched redis-rb that fixes an issue when trying to connect with
67
+ # sentinels and avoids retrying calls when there's a timeout to prevent
68
+ # duplicated commands. It's based on version 4.1.3.
69
+ gem 'redis', git: 'https://github.com/3scale/redis-rb', branch: 'apisonator'
@@ -5,6 +5,13 @@ GIT
5
5
  specs:
6
6
  puma (2.15.3)
7
7
 
8
+ GIT
9
+ remote: https://github.com/3scale/redis-rb
10
+ revision: 35301b3d952975300a4cb30d408ae3b5969d0440
11
+ branch: apisonator
12
+ specs:
13
+ redis (4.1.3)
14
+
8
15
  GIT
9
16
  remote: https://github.com/3scale/resque
10
17
  revision: 88839e71756ea9b6edfc9426a0af71e94109c135
@@ -28,7 +35,7 @@ GIT
28
35
  PATH
29
36
  remote: .
30
37
  specs:
31
- apisonator (2.100.0)
38
+ apisonator (2.100.1.pre1)
32
39
 
33
40
  GEM
34
41
  remote: https://rubygems.org/
@@ -116,7 +123,7 @@ GEM
116
123
  reentrant_flock
117
124
  sinatra (>= 1.2.7)
118
125
  gli (2.16.1)
119
- hiredis (0.6.1)
126
+ hiredis (0.6.3)
120
127
  httpclient (2.8.3)
121
128
  i18n (0.9.1)
122
129
  concurrent-ruby (~> 1.0)
@@ -182,7 +189,6 @@ GEM
182
189
  rack-test (0.8.2)
183
190
  rack (>= 1.0, < 3)
184
191
  rake (13.0.1)
185
- redis (4.1.1)
186
192
  redis-namespace (1.6.0)
187
193
  redis (>= 3.0.4)
188
194
  reentrant_flock (0.1.1)
@@ -284,7 +290,7 @@ DEPENDENCIES
284
290
  falcon (~> 0.35)
285
291
  geminabox (~> 0.13.11)
286
292
  gli (~> 2.16.1)
287
- hiredis (= 0.6.1)
293
+ hiredis (~> 0.6.1)
288
294
  license_finder (~> 5)
289
295
  mocha (~> 1.3)
290
296
  nokogiri (~> 1.10.8)
@@ -297,7 +303,7 @@ DEPENDENCIES
297
303
  rack (~> 2.0.8)
298
304
  rack-test (~> 0.8.2)
299
305
  rake (~> 13.0)
300
- redis (= 4.1.1)
306
+ redis!
301
307
  resque!
302
308
  resque_spec (~> 0.17.0)
303
309
  resque_unit (~> 0.4.4)!
@@ -5,6 +5,13 @@ GIT
5
5
  specs:
6
6
  puma (2.15.3)
7
7
 
8
+ GIT
9
+ remote: https://github.com/3scale/redis-rb
10
+ revision: 35301b3d952975300a4cb30d408ae3b5969d0440
11
+ branch: apisonator
12
+ specs:
13
+ redis (4.1.3)
14
+
8
15
  GIT
9
16
  remote: https://github.com/3scale/resque
10
17
  revision: 88839e71756ea9b6edfc9426a0af71e94109c135
@@ -106,7 +113,7 @@ GEM
106
113
  reentrant_flock
107
114
  sinatra (>= 1.2.7)
108
115
  gli (2.16.1)
109
- hiredis (0.6.1)
116
+ hiredis (0.6.3)
110
117
  httpclient (2.8.3)
111
118
  i18n (0.9.1)
112
119
  concurrent-ruby (~> 1.0)
@@ -170,7 +177,6 @@ GEM
170
177
  rack-test (0.8.2)
171
178
  rack (>= 1.0, < 3)
172
179
  rake (13.0.1)
173
- redis (4.1.1)
174
180
  redis-namespace (1.6.0)
175
181
  redis (>= 3.0.4)
176
182
  reentrant_flock (0.1.1)
@@ -266,7 +272,7 @@ DEPENDENCIES
266
272
  falcon (~> 0.35)
267
273
  geminabox (~> 0.13.11)
268
274
  gli (~> 2.16.1)
269
- hiredis (= 0.6.1)
275
+ hiredis (~> 0.6.1)
270
276
  license_finder (~> 5)
271
277
  mocha (~> 1.3)
272
278
  nokogiri (~> 1.10.8)
@@ -278,7 +284,7 @@ DEPENDENCIES
278
284
  rack (~> 2.0.8)
279
285
  rack-test (~> 0.8.2)
280
286
  rake (~> 13.0)
281
- redis (= 4.1.1)
287
+ redis!
282
288
  resque!
283
289
  resque_spec (~> 0.17.0)
284
290
  resque_unit (~> 0.4.4)!
@@ -5,7 +5,6 @@ require 'builder'
5
5
  require 'hiredis'
6
6
 
7
7
  require 'redis'
8
- require '3scale/backend/extensions/redis'
9
8
 
10
9
  require 'resque'
11
10
  require 'securerandom'
@@ -44,9 +44,13 @@ module ThreeScale
44
44
  connect_timeout: 5,
45
45
  read_timeout: 3,
46
46
  write_timeout: 3,
47
- # this is set to zero to avoid potential double transactions
48
- # see https://github.com/redis/redis-rb/issues/668
49
- reconnect_attempts: 0,
47
+ # Note that we can set reconnect_attempts to >= 0 because we use
48
+ # our redis-rb fork which implements a workaround for this issue
49
+ # that shows that when there might be duplicated transactions when
50
+ # there's a timeout: https://github.com/redis/redis-rb/issues/668
51
+ # We should investigate if there are edge cases that can lead to
52
+ # duplicated commands because of this setting.
53
+ reconnect_attempts: 1,
50
54
  # use by default the C extension client
51
55
  driver: :hiredis
52
56
  }.freeze
@@ -1,5 +1,5 @@
1
1
  module ThreeScale
2
2
  module Backend
3
- VERSION = '2.100.0'
3
+ VERSION = '2.100.1.pre1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apisonator
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.100.0
4
+ version: 2.100.1.pre1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Ciganek
@@ -88,7 +88,6 @@ files:
88
88
  - lib/3scale/backend/extensions/array.rb
89
89
  - lib/3scale/backend/extensions/hash.rb
90
90
  - lib/3scale/backend/extensions/nil_class.rb
91
- - lib/3scale/backend/extensions/redis.rb
92
91
  - lib/3scale/backend/extensions/string.rb
93
92
  - lib/3scale/backend/extensions/time.rb
94
93
  - lib/3scale/backend/failed_jobs_scheduler.rb
@@ -1,44 +0,0 @@
1
- # Monkey-patches a method in Redis::Client::Connector::Sentinel to fix a bug
2
- # with sentinel passwords. It applies the fix in
3
- # https://github.com/redis/redis-rb/pull/856.
4
- #
5
- # The fix was included in 4.1.2, but we cannot upgrade because that version
6
- # drops support for ruby < 2.3.0 which we still need to support.
7
- #
8
- # This should only be temporary. It should be deleted when updating the gem.
9
- class Redis
10
- class Client
11
- class Connector
12
- class Sentinel
13
- def sentinel_detect
14
- @sentinels.each do |sentinel|
15
- client = Redis::Client.new(@options.merge({:host => sentinel[:host],
16
- :port => sentinel[:port],
17
- password: sentinel[:password],
18
- :reconnect_attempts => 0,
19
- }))
20
-
21
- begin
22
- if result = yield(client)
23
- # This sentinel responded. Make sure we ask it first next time.
24
- @sentinels.delete(sentinel)
25
- @sentinels.unshift(sentinel)
26
-
27
- return result
28
- end
29
- rescue BaseConnectionError
30
- rescue RuntimeError => exception
31
- # Needed because when the sentinel address cannot be resolved it
32
- # raises this instead of "BaseConnectionError"
33
- raise unless exception.message =~ /Name or service not known/
34
- ensure
35
- client.disconnect
36
- end
37
- end
38
-
39
- raise CannotConnectError, "No sentinels available."
40
- end
41
- end
42
- end
43
- end
44
- end