zk 0.8.3 → 0.8.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/z_k/pool.rb +9 -3
- data/lib/z_k/version.rb +1 -1
- data/spec/z_k/election_spec.rb +1 -1
- metadata +4 -4
data/lib/z_k/pool.rb
CHANGED
@@ -59,8 +59,10 @@ module ZK
|
|
59
59
|
|
60
60
|
@pool.clear
|
61
61
|
|
62
|
-
|
63
|
-
cnx.
|
62
|
+
until @connections.empty?
|
63
|
+
if cnx = @connections.shift
|
64
|
+
cnx.close!
|
65
|
+
end
|
64
66
|
end
|
65
67
|
|
66
68
|
@state = :closed
|
@@ -105,7 +107,7 @@ module ZK
|
|
105
107
|
end
|
106
108
|
|
107
109
|
def size #:nodoc:
|
108
|
-
@
|
110
|
+
@mutex.synchronize { @pool.size }
|
109
111
|
end
|
110
112
|
|
111
113
|
def pool_state #:nodoc:
|
@@ -191,6 +193,10 @@ module ZK
|
|
191
193
|
|
192
194
|
if @pool.length > 0
|
193
195
|
cnx = @pool.shift
|
196
|
+
|
197
|
+
# XXX(slyphon): not really sure how this case happens, but protect against it as we're
|
198
|
+
# seeing an issue in production
|
199
|
+
next if cnx.nil?
|
194
200
|
|
195
201
|
# if the connection isn't connected, then set up an on_connection
|
196
202
|
# handler and try the next one in the pool
|
data/lib/z_k/version.rb
CHANGED
data/spec/z_k/election_spec.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 55
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 8
|
9
|
-
-
|
10
|
-
version: 0.8.
|
9
|
+
- 4
|
10
|
+
version: 0.8.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jonathan D. Simms
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2011-
|
19
|
+
date: 2011-07-08 00:00:00 +00:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|