moped 2.0.2 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of moped might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -1
- data/README.md +1 -1
- data/lib/moped/address.rb +2 -1
- data/lib/moped/connection/manager.rb +20 -0
- data/lib/moped/node.rb +3 -3
- data/lib/moped/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c42ef9279d08c76ecf69539b067b93ab0878f4e
|
4
|
+
data.tar.gz: 3a12fc6c37618f64b7554483f186bac840df90bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a636e60201e811f5ea5334ae6e2d3418e2c3c483ae992183172abadadf5ffa0b1682acbac4e03684e4d2dede020d3f562e3a512dbfe6395b19615746fc121707
|
7
|
+
data.tar.gz: b733ee7605f748665b060621b7a65bc1ee2ca610f6079ca96c76563329b9140f25468c618e96986abda5be9e963aa52881c6f3982f98d99c5245ae415170c428
|
data/CHANGELOG.md
CHANGED
@@ -1,12 +1,19 @@
|
|
1
1
|
# Overview
|
2
2
|
|
3
|
+
## 2.0.3
|
4
|
+
|
5
|
+
### Resolved Issues
|
6
|
+
|
7
|
+
* \#333, \#336
|
8
|
+
Disconnect even when IP address not resolved and fix shutdown pool for node. (durran)
|
9
|
+
|
3
10
|
## 2.0.2
|
4
11
|
|
5
12
|
### Resolved Issues
|
6
13
|
|
7
14
|
* Dont include peers if node already in the list
|
8
15
|
There was a big memory leak, that was including all
|
9
|
-
nodes in the list in every refresh cycle(Arthur Neves)
|
16
|
+
nodes in the list in every refresh cycle. (Arthur Neves)
|
10
17
|
|
11
18
|
## 2.0.1
|
12
19
|
|
data/README.md
CHANGED
@@ -25,7 +25,7 @@ the Moped section: [mongoid.org](http://mongoid.org/en/moped/)
|
|
25
25
|
License
|
26
26
|
-------
|
27
27
|
|
28
|
-
Copyright (c) 2011-
|
28
|
+
Copyright (c) 2011-2014 Bernerd Schaefer, Durran Jordan
|
29
29
|
|
30
30
|
Permission is hereby granted, free of charge, to any person obtaining
|
31
31
|
a copy of this software and associated documentation files (the
|
data/lib/moped/address.rb
CHANGED
@@ -46,6 +46,7 @@ module Moped
|
|
46
46
|
# @since 2.0.0
|
47
47
|
def resolve(node)
|
48
48
|
begin
|
49
|
+
return @resolved if @resolved
|
49
50
|
Timeout::timeout(@timeout) do
|
50
51
|
Resolv.each_address(host) do |ip|
|
51
52
|
if ip =~ Resolv::IPv4::Regex
|
@@ -55,7 +56,7 @@ module Moped
|
|
55
56
|
end
|
56
57
|
raise Resolv::ResolvError unless @ip
|
57
58
|
end
|
58
|
-
@resolved
|
59
|
+
@resolved = "#{ip}:#{port}"
|
59
60
|
rescue Timeout::Error, Resolv::ResolvError, SocketError
|
60
61
|
Loggable.warn(" MOPED:", "Could not resolve IP for: #{original}", "n/a")
|
61
62
|
node.down! and false
|
@@ -35,6 +35,26 @@ module Moped
|
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
38
|
+
# Shutdown the connection pool for the provided node. In the case of
|
39
|
+
# unresolved IP addresses the resolved address would be nil resulting in
|
40
|
+
# the same pool for all nodes that did not have IP resolved.
|
41
|
+
#
|
42
|
+
# @example Shut down the connection pool.
|
43
|
+
# Manager.shutdown(node)
|
44
|
+
#
|
45
|
+
# @param [ Node ] node The node.
|
46
|
+
#
|
47
|
+
# @return [ nil ] Always nil.
|
48
|
+
#
|
49
|
+
# @since 2.0.3
|
50
|
+
def shutdown(node)
|
51
|
+
MUTEX.synchronize do
|
52
|
+
pool = pools.delete(node.address.resolved)
|
53
|
+
pool.shutdown{ |conn| conn.disconnect } if pool
|
54
|
+
nil
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
38
58
|
private
|
39
59
|
|
40
60
|
# Create a new connection pool for the provided node.
|
data/lib/moped/node.rb
CHANGED
@@ -137,7 +137,7 @@ module Moped
|
|
137
137
|
#
|
138
138
|
# @since 1.2.0
|
139
139
|
def disconnect
|
140
|
-
connection{ |conn| conn.disconnect }
|
140
|
+
connection{ |conn| conn.disconnect }
|
141
141
|
true
|
142
142
|
end
|
143
143
|
|
@@ -150,9 +150,10 @@ module Moped
|
|
150
150
|
#
|
151
151
|
# @since 2.0.0
|
152
152
|
def down!
|
153
|
+
@pool = Connection::Manager.shutdown(self)
|
153
154
|
@down_at = Time.new
|
154
155
|
@latency = nil
|
155
|
-
|
156
|
+
true
|
156
157
|
end
|
157
158
|
|
158
159
|
# Yields the block if a connection can be established, retrying when a
|
@@ -185,7 +186,6 @@ module Moped
|
|
185
186
|
ensure
|
186
187
|
end_execution(:connection)
|
187
188
|
end
|
188
|
-
|
189
189
|
end
|
190
190
|
|
191
191
|
# Set a flag on the node for the duration of provided block so that an
|
data/lib/moped/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: moped
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Durran Jordan
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2015-01-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bson
|