cql-rb 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/cql/io/connection.rb +1 -1
- data/lib/cql/version.rb +1 -1
- data/spec/cql/io/connection_spec.rb +24 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NzFiOTFkMzdmNTNhMzkzYzg0ZmM5ZGViZDI4NTk1OTk0NzM0NmY0Mg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MzRkNDQ2YjE0YmUyMjg0YTYyOWFhOTY4MDE2NGYwZDUwOTIxODEyOA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NGQwOWEyNzdiYTc0YThjNWNiNGMzODAwMGY3NDgwMWEwYzEzZGRhYmQ1N2Iz
|
10
|
+
MDljZTkyY2EwNzE3ZTY4ZWMyMGIyZWYyZTM2MWUyMDQyMDNiY2RmYTlhODli
|
11
|
+
ZTBjOTM1MmY3NGM5NDQxMDY1OTJkNWM0NDBlMDdjMjE0ZDMzY2Q=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZjViNmJkNmQyYWIwZmQ4NGM4ZmJjMGFiYzc1NjFlZDRiYjBhZmU1ZGIxMzEw
|
14
|
+
MjQwOTAzODk1YmZjMTQyMDYyNDFhZTIyNDZiYmNjNDlhZDUwZDI4MWQ1MTIx
|
15
|
+
YTMwM2MwNjE0MDI4NDM5MTM5MjkyZjdkMDIyZDMxODk1NDhkYjc=
|
data/lib/cql/io/connection.rb
CHANGED
@@ -50,7 +50,7 @@ module Cql
|
|
50
50
|
if @clock.now - @connection_started_at > @connection_timeout
|
51
51
|
close(ConnectionTimeoutError.new("Could not connect to #{@host}:#{@port} within #{@connection_timeout}s"))
|
52
52
|
end
|
53
|
-
rescue Errno::EINVAL => e
|
53
|
+
rescue Errno::EINVAL, Errno::ECONNREFUSED => e
|
54
54
|
if @addrinfos.empty?
|
55
55
|
close(e)
|
56
56
|
else
|
data/lib/cql/version.rb
CHANGED
@@ -137,6 +137,30 @@ module Cql
|
|
137
137
|
end
|
138
138
|
end
|
139
139
|
|
140
|
+
context 'when #connect_nonblock raises ECONNREFUSED' do
|
141
|
+
before do
|
142
|
+
socket_impl.stub(:sockaddr_in)
|
143
|
+
.with('PORT', 'IP2')
|
144
|
+
.and_return('SOCKADDR2')
|
145
|
+
socket_impl.stub(:new)
|
146
|
+
.with('FAMILY2', 'TYPE2', 0)
|
147
|
+
.and_return(socket)
|
148
|
+
socket.stub(:close)
|
149
|
+
end
|
150
|
+
|
151
|
+
it 'attempts to connect to the next address given by #getaddinfo' do
|
152
|
+
socket.should_receive(:connect_nonblock).with('SOCKADDR1').and_raise(Errno::ECONNREFUSED)
|
153
|
+
socket.should_receive(:connect_nonblock).with('SOCKADDR2')
|
154
|
+
handler.connect
|
155
|
+
end
|
156
|
+
|
157
|
+
it 'fails if there are no more addresses to try' do
|
158
|
+
socket.stub(:connect_nonblock).and_raise(Errno::ECONNREFUSED)
|
159
|
+
f = handler.connect
|
160
|
+
expect { f.value }.to raise_error(ConnectionError)
|
161
|
+
end
|
162
|
+
end
|
163
|
+
|
140
164
|
context 'when #connect_nonblock raises SystemCallError' do
|
141
165
|
before do
|
142
166
|
socket.stub(:connect_nonblock).and_raise(SystemCallError.new('Bork!', 9999))
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cql-rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Theo Hultberg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A pure Ruby CQL3 driver for Cassandra
|
14
14
|
email:
|