redis 3.3.0 → 3.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +34 -10
- data/CHANGELOG.md +5 -0
- data/lib/redis/connection/ruby.rb +38 -3
- data/lib/redis/version.rb +1 -1
- data/test/internals_test.rb +20 -0
- data/test/sentinel_command_test.rb +1 -1
- data/test/sentinel_test.rb +1 -1
- metadata +11 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4744291b8bc26230044fc12c456951a60c5802c7
|
4
|
+
data.tar.gz: 6eabe9bb60b74aa2408007a72f9a44e831b71a5e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7fb460a3595ed430dbf4dab6f516dcbef029cf1c72350e4e50b7e425e8d94b8d47760d33f58db21bad95852ec97fa7fdba55cfb0858292c221c947516a291f97
|
7
|
+
data.tar.gz: 7cdf461c39d5eede9b295bf987391cd70461cd5adcee945ae243d509f67457ea14aa0ad08ca47efdab8bb8ca315d6bdff94460d6cecc6b981f459081cd93dfbd
|
data/.travis.yml
CHANGED
@@ -21,9 +21,12 @@ env:
|
|
21
21
|
- VERBOSE=true
|
22
22
|
- TIMEOUT=1
|
23
23
|
matrix:
|
24
|
-
- conn=ruby REDIS_BRANCH=
|
25
|
-
- conn=
|
26
|
-
- conn=
|
24
|
+
- conn=ruby REDIS_BRANCH=3.0
|
25
|
+
- conn=ruby REDIS_BRANCH=3.2
|
26
|
+
- conn=hiredis REDIS_BRANCH=3.0
|
27
|
+
- conn=hiredis REDIS_BRANCH=3.2
|
28
|
+
- conn=synchrony REDIS_BRANCH=3.0
|
29
|
+
- conn=synchrony REDIS_BRANCH=3.2
|
27
30
|
- conn=ruby REDIS_BRANCH=unstable
|
28
31
|
|
29
32
|
branches:
|
@@ -35,27 +38,48 @@ matrix:
|
|
35
38
|
# hiredis
|
36
39
|
- rvm: jruby-18mode
|
37
40
|
gemfile: .travis/Gemfile
|
38
|
-
env: conn=hiredis REDIS_BRANCH=
|
41
|
+
env: conn=hiredis REDIS_BRANCH=3.0
|
42
|
+
- rvm: jruby-18mode
|
43
|
+
gemfile: .travis/Gemfile
|
44
|
+
env: conn=hiredis REDIS_BRANCH=3.2
|
45
|
+
- rvm: jruby-19mode
|
46
|
+
gemfile: .travis/Gemfile
|
47
|
+
env: conn=hiredis REDIS_BRANCH=3.0
|
39
48
|
- rvm: jruby-19mode
|
40
49
|
gemfile: .travis/Gemfile
|
41
|
-
env: conn=hiredis REDIS_BRANCH=2
|
50
|
+
env: conn=hiredis REDIS_BRANCH=3.2
|
42
51
|
- rvm: jruby-9.0.5.0
|
43
52
|
gemfile: .travis/Gemfile
|
44
|
-
env: conn=hiredis REDIS_BRANCH=
|
53
|
+
env: conn=hiredis REDIS_BRANCH=3.0
|
54
|
+
- rvm: jruby-9.0.5.0
|
55
|
+
gemfile: .travis/Gemfile
|
56
|
+
env: conn=hiredis REDIS_BRANCH=3.2
|
45
57
|
|
46
58
|
# synchrony
|
47
59
|
- rvm: 1.8.7
|
48
60
|
gemfile: .travis/Gemfile
|
49
|
-
env: conn=synchrony REDIS_BRANCH=
|
61
|
+
env: conn=synchrony REDIS_BRANCH=3.0
|
62
|
+
- rvm: 1.8.7
|
63
|
+
gemfile: .travis/Gemfile
|
64
|
+
env: conn=synchrony REDIS_BRANCH=3.2
|
65
|
+
- rvm: jruby-18mode
|
66
|
+
gemfile: .travis/Gemfile
|
67
|
+
env: conn=synchrony REDIS_BRANCH=3.0
|
50
68
|
- rvm: jruby-18mode
|
51
69
|
gemfile: .travis/Gemfile
|
52
|
-
env: conn=synchrony REDIS_BRANCH=2
|
70
|
+
env: conn=synchrony REDIS_BRANCH=3.2
|
53
71
|
- rvm: jruby-19mode
|
54
72
|
gemfile: .travis/Gemfile
|
55
|
-
env: conn=synchrony REDIS_BRANCH=
|
73
|
+
env: conn=synchrony REDIS_BRANCH=3.0
|
74
|
+
- rvm: jruby-19mode
|
75
|
+
gemfile: .travis/Gemfile
|
76
|
+
env: conn=synchrony REDIS_BRANCH=3.2
|
77
|
+
- rvm: jruby-9.0.5.0
|
78
|
+
gemfile: .travis/Gemfile
|
79
|
+
env: conn=synchrony REDIS_BRANCH=3.0
|
56
80
|
- rvm: jruby-9.0.5.0
|
57
81
|
gemfile: .travis/Gemfile
|
58
|
-
env: conn=synchrony REDIS_BRANCH=2
|
82
|
+
env: conn=synchrony REDIS_BRANCH=3.2
|
59
83
|
allow_failures:
|
60
84
|
- rvm: rbx-2
|
61
85
|
|
data/CHANGELOG.md
CHANGED
@@ -12,6 +12,11 @@
|
|
12
12
|
security updates in June of 2013; continuing to support it would prevent
|
13
13
|
the use of newer features of Ruby.
|
14
14
|
|
15
|
+
# 3.3.1
|
16
|
+
|
17
|
+
* Remove usage of Timeout::timeout, refactor into using low level non-blocking writes.
|
18
|
+
This fixes a memory leak due to Timeout creating threads on each invocation.
|
19
|
+
|
15
20
|
# 3.3.0
|
16
21
|
|
17
22
|
* Added support for SSL/TLS. Redis doesn't support SSL natively, so you still
|
@@ -10,6 +10,16 @@ rescue LoadError
|
|
10
10
|
# Not all systems have OpenSSL support
|
11
11
|
end
|
12
12
|
|
13
|
+
if RUBY_VERSION < "1.9.3"
|
14
|
+
class String
|
15
|
+
# Ruby 1.8.7 does not have byteslice, but it handles encodings differently anyway.
|
16
|
+
# We can simply slice the string, which is a byte array there.
|
17
|
+
def byteslice(*args)
|
18
|
+
slice(*args)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
13
23
|
class Redis
|
14
24
|
module Connection
|
15
25
|
module SocketMixin
|
@@ -80,9 +90,34 @@ class Redis
|
|
80
90
|
raise Errno::ECONNRESET
|
81
91
|
end
|
82
92
|
|
83
|
-
|
84
|
-
|
85
|
-
|
93
|
+
def _write_to_socket(data)
|
94
|
+
begin
|
95
|
+
write_nonblock(data)
|
96
|
+
|
97
|
+
rescue *NBIO_EXCEPTIONS
|
98
|
+
if IO.select(nil, [self], nil, @write_timeout)
|
99
|
+
retry
|
100
|
+
else
|
101
|
+
raise Redis::TimeoutError
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
rescue EOFError
|
106
|
+
raise Errno::ECONNRESET
|
107
|
+
end
|
108
|
+
|
109
|
+
def write(data)
|
110
|
+
return super(data) unless @write_timeout
|
111
|
+
|
112
|
+
length = data.bytesize
|
113
|
+
total_count = 0
|
114
|
+
loop do
|
115
|
+
count = _write_to_socket(data)
|
116
|
+
|
117
|
+
total_count += count
|
118
|
+
return total_count if total_count >= length
|
119
|
+
data = data.byteslice(count..-1)
|
120
|
+
end
|
86
121
|
end
|
87
122
|
end
|
88
123
|
|
data/lib/redis/version.rb
CHANGED
data/test/internals_test.rb
CHANGED
@@ -5,6 +5,7 @@ require File.expand_path("helper", File.dirname(__FILE__))
|
|
5
5
|
class TestInternals < Test::Unit::TestCase
|
6
6
|
|
7
7
|
include Helper::Client
|
8
|
+
include Helper::Skipable
|
8
9
|
|
9
10
|
def test_logger
|
10
11
|
r.ping
|
@@ -160,6 +161,25 @@ class TestInternals < Test::Unit::TestCase
|
|
160
161
|
assert (Time.now - start_time) <= opts[:timeout]
|
161
162
|
end
|
162
163
|
|
164
|
+
driver(:ruby) do
|
165
|
+
def test_write_timeout
|
166
|
+
return skip("Relies on buffer sizes, might be unreliable")
|
167
|
+
|
168
|
+
server = TCPServer.new("127.0.0.1", 0)
|
169
|
+
port = server.addr[1]
|
170
|
+
|
171
|
+
# Hacky, but we need the buffer size
|
172
|
+
val = TCPSocket.new("127.0.0.1", port).getsockopt(Socket::SOL_SOCKET, Socket::SO_SNDBUF).unpack("i")[0]
|
173
|
+
|
174
|
+
assert_raise(Redis::TimeoutError) do
|
175
|
+
Timeout.timeout(1) do
|
176
|
+
redis = Redis.new(:port => port, :timeout => 5, :write_timeout => 0.1)
|
177
|
+
redis.set("foo", "1" * val*2)
|
178
|
+
end
|
179
|
+
end
|
180
|
+
end
|
181
|
+
end
|
182
|
+
|
163
183
|
def close_on_ping(seq, options = {})
|
164
184
|
$request = 0
|
165
185
|
|
data/test/sentinel_test.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: 3.3.
|
4
|
+
version: 3.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ezra Zygmuntowicz
|
@@ -16,20 +16,20 @@ authors:
|
|
16
16
|
autorequire:
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
|
-
date: 2016-
|
19
|
+
date: 2016-07-18 00:00:00.000000000 Z
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
22
|
name: rake
|
23
23
|
requirement: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- - <
|
25
|
+
- - "<"
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: 11.0.0
|
28
28
|
type: :development
|
29
29
|
prerelease: false
|
30
30
|
version_requirements: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
|
-
- - <
|
32
|
+
- - "<"
|
33
33
|
- !ruby/object:Gem::Version
|
34
34
|
version: 11.0.0
|
35
35
|
- !ruby/object:Gem::Dependency
|
@@ -56,10 +56,10 @@ executables: []
|
|
56
56
|
extensions: []
|
57
57
|
extra_rdoc_files: []
|
58
58
|
files:
|
59
|
-
- .gitignore
|
60
|
-
- .travis.yml
|
61
|
-
- .travis/Gemfile
|
62
|
-
- .yardopts
|
59
|
+
- ".gitignore"
|
60
|
+
- ".travis.yml"
|
61
|
+
- ".travis/Gemfile"
|
62
|
+
- ".yardopts"
|
63
63
|
- CHANGELOG.md
|
64
64
|
- Gemfile
|
65
65
|
- LICENSE
|
@@ -184,17 +184,17 @@ require_paths:
|
|
184
184
|
- lib
|
185
185
|
required_ruby_version: !ruby/object:Gem::Requirement
|
186
186
|
requirements:
|
187
|
-
- -
|
187
|
+
- - ">="
|
188
188
|
- !ruby/object:Gem::Version
|
189
189
|
version: '0'
|
190
190
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
191
191
|
requirements:
|
192
|
-
- -
|
192
|
+
- - ">="
|
193
193
|
- !ruby/object:Gem::Version
|
194
194
|
version: '0'
|
195
195
|
requirements: []
|
196
196
|
rubyforge_project:
|
197
|
-
rubygems_version: 2.
|
197
|
+
rubygems_version: 2.5.1
|
198
198
|
signing_key:
|
199
199
|
specification_version: 4
|
200
200
|
summary: A Ruby client library for Redis
|