redis 4.1.1 → 4.1.2
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 +5 -5
- data/CHANGELOG.md +17 -0
- data/README.md +9 -0
- data/lib/redis.rb +1 -1
- data/lib/redis/client.rb +1 -5
- data/lib/redis/connection/ruby.rb +22 -1
- data/lib/redis/version.rb +1 -1
- metadata +4 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: c0b16163b5714933ba20edb9595d7669c7270502586546f3e8758192039113c1
|
4
|
+
data.tar.gz: 150dacb8ae77a51536e3f2bc6813144b0176415d008adaa5d5e6c4d7f25624a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 90a9fcfdefc41f5feaedfea2bde2be1ad39308dee10f0045ec227577d067d795aaaede4aec200ed6f5777167842540ff5adb6a927fe6a0a0e5ac46ea8eeaf737
|
7
|
+
data.tar.gz: 90c74c87892ef96d0d6ef2bd5934f8e3064d30064a9310fc2b1e31aba066ccb6a005d030458a35d9ad09ed403749e3356df3072927e6a749fc21caedee75f936
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,22 @@
|
|
1
1
|
# Unreleased
|
2
2
|
|
3
|
+
# 4.1.2
|
4
|
+
|
5
|
+
* Fix the client hanging forever when connecting with SSL to a non-SSL server. See #835.
|
6
|
+
* Fix several authentication problems with sentinel. See #850 and #856.
|
7
|
+
* Explicitly drop Ruby 2.2 support.
|
8
|
+
|
9
|
+
|
10
|
+
# 4.1.1
|
11
|
+
|
12
|
+
* Fix error handling in multi blocks. See #754.
|
13
|
+
* Fix geoadd to accept arrays like georadius and georadiusbymember. See #841.
|
14
|
+
* Fix georadius command failing when long == lat. See #841.
|
15
|
+
* Fix timeout error in xread block: 0. See #837.
|
16
|
+
* Fix incompatibility issue with redis-objects. See #834.
|
17
|
+
* Properly handle Errno::EADDRNOTAVAIL on connect.
|
18
|
+
* Fix password authentication to sentinel instances. See #813.
|
19
|
+
|
3
20
|
# 4.1.0
|
4
21
|
|
5
22
|
* Add Redis Cluster support. See #716.
|
data/README.md
CHANGED
@@ -95,6 +95,15 @@ but a few so that if one is down the client will try the next one. The client
|
|
95
95
|
is able to remember the last Sentinel that was able to reply correctly and will
|
96
96
|
use it for the next requests.
|
97
97
|
|
98
|
+
If you want to [authenticate](https://redis.io/topics/sentinel#configuring-sentinel-instances-with-authentication) Sentinel itself, you must specify the `password` option per instance.
|
99
|
+
|
100
|
+
```ruby
|
101
|
+
SENTINELS = [{ host: '127.0.0.1', port: 26380, password: 'mysecret' },
|
102
|
+
{ host: '127.0.0.1', port: 26381, password: 'mysecret' }]
|
103
|
+
|
104
|
+
redis = Redis.new(host: 'mymaster', sentinels: SENTINELS, role: :master)
|
105
|
+
```
|
106
|
+
|
98
107
|
## Cluster support
|
99
108
|
|
100
109
|
`redis-rb` supports [clustering](https://redis.io/topics/cluster-spec).
|
data/lib/redis.rb
CHANGED
@@ -2823,7 +2823,7 @@ class Redis
|
|
2823
2823
|
#
|
2824
2824
|
# @param [String] key
|
2825
2825
|
# @param [Array] member arguemnts for member or members: longitude, latitude, name
|
2826
|
-
# @return [
|
2826
|
+
# @return [Integer] number of elements added to the sorted set
|
2827
2827
|
def geoadd(key, *member)
|
2828
2828
|
synchronize do |client|
|
2829
2829
|
client.call([:geoadd, key, *member])
|
data/lib/redis/client.rb
CHANGED
@@ -577,6 +577,7 @@ class Redis
|
|
577
577
|
client = Client.new(@options.merge({
|
578
578
|
:host => sentinel[:host],
|
579
579
|
:port => sentinel[:port],
|
580
|
+
password: sentinel[:password],
|
580
581
|
:reconnect_attempts => 0,
|
581
582
|
}))
|
582
583
|
|
@@ -595,11 +596,6 @@ class Redis
|
|
595
596
|
end
|
596
597
|
|
597
598
|
raise CannotConnectError, "No sentinels available."
|
598
|
-
rescue Redis::CommandError => err
|
599
|
-
# this feature is only available starting with Redis 5.0.1
|
600
|
-
raise unless err.message.start_with?('ERR unknown command `auth`')
|
601
|
-
@options[:password] = DEFAULTS.fetch(:password)
|
602
|
-
retry
|
603
599
|
end
|
604
600
|
|
605
601
|
def resolve_master
|
@@ -266,7 +266,28 @@ class Redis
|
|
266
266
|
|
267
267
|
ssl_sock = new(tcp_sock, ctx)
|
268
268
|
ssl_sock.hostname = host
|
269
|
-
|
269
|
+
|
270
|
+
begin
|
271
|
+
# Initiate the socket connection in the background. If it doesn't fail
|
272
|
+
# immediately it will raise an IO::WaitWritable (Errno::EINPROGRESS)
|
273
|
+
# indicating the connection is in progress.
|
274
|
+
# Unlike waiting for a tcp socket to connect, you can't time out ssl socket
|
275
|
+
# connections during the connect phase properly, because IO.select only partially works.
|
276
|
+
# Instead, you have to retry.
|
277
|
+
ssl_sock.connect_nonblock
|
278
|
+
rescue Errno::EAGAIN, Errno::EWOULDBLOCK, IO::WaitReadable
|
279
|
+
if IO.select([ssl_sock], nil, nil, timeout)
|
280
|
+
retry
|
281
|
+
else
|
282
|
+
raise TimeoutError
|
283
|
+
end
|
284
|
+
rescue IO::WaitWritable
|
285
|
+
if IO.select(nil, [ssl_sock], nil, timeout)
|
286
|
+
retry
|
287
|
+
else
|
288
|
+
raise TimeoutError
|
289
|
+
end
|
290
|
+
end
|
270
291
|
|
271
292
|
unless ctx.verify_mode == OpenSSL::SSL::VERIFY_NONE
|
272
293
|
ssl_sock.post_connection_check(host)
|
data/lib/redis/version.rb
CHANGED
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.
|
4
|
+
version: 4.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ezra Zygmuntowicz
|
@@ -16,22 +16,8 @@ authors:
|
|
16
16
|
autorequire:
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
|
-
date: 2019-05-
|
19
|
+
date: 2019-05-30 00:00:00.000000000 Z
|
20
20
|
dependencies:
|
21
|
-
- !ruby/object:Gem::Dependency
|
22
|
-
name: test-unit
|
23
|
-
requirement: !ruby/object:Gem::Requirement
|
24
|
-
requirements:
|
25
|
-
- - ">="
|
26
|
-
- !ruby/object:Gem::Version
|
27
|
-
version: 3.1.5
|
28
|
-
type: :development
|
29
|
-
prerelease: false
|
30
|
-
version_requirements: !ruby/object:Gem::Requirement
|
31
|
-
requirements:
|
32
|
-
- - ">="
|
33
|
-
- !ruby/object:Gem::Version
|
34
|
-
version: 3.1.5
|
35
21
|
- !ruby/object:Gem::Dependency
|
36
22
|
name: mocha
|
37
23
|
requirement: !ruby/object:Gem::Requirement
|
@@ -122,15 +108,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
122
108
|
requirements:
|
123
109
|
- - ">="
|
124
110
|
- !ruby/object:Gem::Version
|
125
|
-
version: 2.
|
111
|
+
version: 2.3.0
|
126
112
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
127
113
|
requirements:
|
128
114
|
- - ">="
|
129
115
|
- !ruby/object:Gem::Version
|
130
116
|
version: '0'
|
131
117
|
requirements: []
|
132
|
-
|
133
|
-
rubygems_version: 2.5.1
|
118
|
+
rubygems_version: 3.0.3
|
134
119
|
signing_key:
|
135
120
|
specification_version: 4
|
136
121
|
summary: A Ruby client library for Redis
|