redis 4.1.2 → 4.1.3

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: c0b16163b5714933ba20edb9595d7669c7270502586546f3e8758192039113c1
4
- data.tar.gz: 150dacb8ae77a51536e3f2bc6813144b0176415d008adaa5d5e6c4d7f25624a1
3
+ metadata.gz: 435d4e9027443183a1003530b77bf10e56240d22ae4726964431c910c31400c9
4
+ data.tar.gz: 57c0a429e09e618bc2694a5b32a0723c368088c0b143012d8a42c5eb85777909
5
5
  SHA512:
6
- metadata.gz: 90a9fcfdefc41f5feaedfea2bde2be1ad39308dee10f0045ec227577d067d795aaaede4aec200ed6f5777167842540ff5adb6a927fe6a0a0e5ac46ea8eeaf737
7
- data.tar.gz: 90c74c87892ef96d0d6ef2bd5934f8e3064d30064a9310fc2b1e31aba066ccb6a005d030458a35d9ad09ed403749e3356df3072927e6a749fc21caedee75f936
6
+ metadata.gz: c82aea61505847b13583c327ca0437564111153a0d37455f294feb8c87f885582589b17f638409553e174b790b5898e42ab79a3e09ab4ebf607a6a5f8205f3da
7
+ data.tar.gz: 9edffdf06ee68e7a216f34a30bd7e3203188f4b1cbda4c9976ff616edb0839a46e4935830165545a4829d9aed80345d5145dcdf92fa87d9dcffe8094fb70f0ce
@@ -1,8 +1,11 @@
1
1
  # Unreleased
2
2
 
3
- # 4.1.2
3
+ # 4.1.3
4
4
 
5
5
  * Fix the client hanging forever when connecting with SSL to a non-SSL server. See #835.
6
+
7
+ # 4.1.2
8
+
6
9
  * Fix several authentication problems with sentinel. See #850 and #856.
7
10
  * Explicitly drop Ruby 2.2 support.
8
11
 
data/README.md CHANGED
@@ -142,6 +142,7 @@ redis.mget('{key}1', '{key}2')
142
142
  ```
143
143
 
144
144
  * The client automatically reconnects after a failover occurred, but the caller is responsible for handling errors while it is happening.
145
+ * The client support permanent node failures, and will reroute requests to promoted slaves.
145
146
  * The client supports `MOVED` and `ASK` redirections transparently.
146
147
 
147
148
  ## Storing objects
@@ -436,6 +437,10 @@ redis = Redis.new(:driver => :synchrony)
436
437
  This library is tested against recent Ruby and Redis versions.
437
438
  Check [Travis][travis-link] for the exact versions supported.
438
439
 
440
+ ## See Also
441
+
442
+ - [async-redis](https://github.com/socketry/async-redis) — An [async](https://github.com/socketry/async) compatible Redis client.
443
+
439
444
  ## Contributors
440
445
 
441
446
  Several people contributed to redis-rb, but we would like to especially
@@ -1164,21 +1164,21 @@ class Redis
1164
1164
  end
1165
1165
 
1166
1166
  def _bpop(cmd, args, &blk)
1167
- options = {}
1168
-
1169
- if args.last.is_a?(Hash)
1167
+ timeout = if args.last.is_a?(Hash)
1170
1168
  options = args.pop
1169
+ options[:timeout]
1171
1170
  elsif args.last.respond_to?(:to_int)
1172
1171
  # Issue deprecation notice in obnoxious mode...
1173
- options[:timeout] = args.pop.to_int
1172
+ args.pop.to_int
1174
1173
  end
1175
1174
 
1175
+ timeout ||= 0
1176
+
1176
1177
  if args.size > 1
1177
1178
  # Issue deprecation notice in obnoxious mode...
1178
1179
  end
1179
1180
 
1180
1181
  keys = args.flatten
1181
- timeout = options[:timeout] || 0
1182
1182
 
1183
1183
  synchronize do |client|
1184
1184
  command = [cmd, keys, timeout]
@@ -226,6 +226,9 @@ class Redis
226
226
  else
227
227
  raise
228
228
  end
229
+ rescue CannotConnectError
230
+ update_cluster_info!
231
+ raise
229
232
  end
230
233
 
231
234
  def assign_redirection_node(err_msg)
@@ -289,7 +289,7 @@ class Redis
289
289
  end
290
290
  end
291
291
 
292
- unless ctx.verify_mode == OpenSSL::SSL::VERIFY_NONE
292
+ unless ctx.verify_mode == OpenSSL::SSL::VERIFY_NONE || (ctx.respond_to?(:verify_hostname) && !ctx.verify_hostname)
293
293
  ssl_sock.post_connection_check(host)
294
294
  end
295
295
 
@@ -321,6 +321,7 @@ class Redis
321
321
  instance.timeout = config[:read_timeout]
322
322
  instance.write_timeout = config[:write_timeout]
323
323
  instance.set_tcp_keepalive config[:tcp_keepalive]
324
+ instance.set_tcp_nodelay if sock.is_a? TCPSocket
324
325
  instance
325
326
  end
326
327
 
@@ -351,6 +352,16 @@ class Redis
351
352
  end
352
353
  end
353
354
 
355
+ # disables Nagle's Algorithm, prevents multiple round trips with MULTI
356
+ if [:IPPROTO_TCP, :TCP_NODELAY].all?{|c| Socket.const_defined? c}
357
+ def set_tcp_nodelay
358
+ @sock.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1)
359
+ end
360
+ else
361
+ def set_tcp_nodelay
362
+ end
363
+ end
364
+
354
365
  def initialize(sock)
355
366
  @sock = sock
356
367
  end
@@ -401,13 +401,12 @@ class Redis
401
401
  end
402
402
 
403
403
  def _bpop(cmd, args)
404
- options = {}
405
-
406
- if args.last.is_a?(Hash)
404
+ timeout = if args.last.is_a?(Hash)
407
405
  options = args.pop
406
+ options[:timeout]
408
407
  elsif args.last.respond_to?(:to_int)
409
408
  # Issue deprecation notice in obnoxious mode...
410
- options[:timeout] = args.pop.to_int
409
+ args.pop.to_int
411
410
  end
412
411
 
413
412
  if args.size > 1
@@ -417,7 +416,11 @@ class Redis
417
416
  keys = args.flatten
418
417
 
419
418
  ensure_same_node(cmd, keys) do |node|
420
- node.__send__(cmd, keys, options)
419
+ if timeout
420
+ node.__send__(cmd, keys, timeout: timeout)
421
+ else
422
+ node.__send__(cmd, keys)
423
+ end
421
424
  end
422
425
  end
423
426
 
@@ -1,3 +1,3 @@
1
1
  class Redis
2
- VERSION = '4.1.2'
2
+ VERSION = '4.1.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.2
4
+ version: 4.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ezra Zygmuntowicz
@@ -16,7 +16,7 @@ authors:
16
16
  autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
- date: 2019-05-30 00:00:00.000000000 Z
19
+ date: 2019-09-17 00:00:00.000000000 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: mocha
@@ -115,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
115
115
  - !ruby/object:Gem::Version
116
116
  version: '0'
117
117
  requirements: []
118
- rubygems_version: 3.0.3
118
+ rubygems_version: 3.0.4
119
119
  signing_key:
120
120
  specification_version: 4
121
121
  summary: A Ruby client library for Redis