ridley-connectors 1.7.0 → 1.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/ridley-connectors/host_commander.rb +15 -1
- data/lib/ridley-connectors/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e88e7d1466ed5f5f4eba7ab10027d7de1bab2a1a
|
4
|
+
data.tar.gz: 524114a995de24ce56a8e196116f438ad0f94c22
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b7f907f07d2754a34fbfa7e21dfebddb0fdc22eeeebcbc646bcd791d3ff9636cb60624eb8bc7d34b5084b2795857ff0c7dce600598f5225dcf9344b74f9d9fb7
|
7
|
+
data.tar.gz: b077c34a56b4a0f2d5631fe9e277d1bf8c716d41757011746f29dc311ca0387312da5c19e7bf4259de3a52b833f31689949a62034eb1824b7ffce468715a2c67
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
## v.1.7.1
|
2
|
+
|
3
|
+
* [#16](https://github.com/RiotGames/ridley-connectors/pull/16) JRuby throws different exceptions when it can't connect to a node
|
4
|
+
|
1
5
|
## v.1.7.0
|
2
6
|
|
3
7
|
* [#15](https://github.com/RiotGames/ridley-connectors/pull/15) Add retries to ssh and winrm connections
|
@@ -1,10 +1,15 @@
|
|
1
|
+
require 'buff/ruby_engine'
|
2
|
+
|
1
3
|
module Ridley
|
2
4
|
class ConnectorSupervisor < ::Celluloid::SupervisionGroup
|
5
|
+
include Ridley::Logging
|
6
|
+
|
3
7
|
# @param [Celluloid::Registry] registry
|
4
8
|
def initialize(registry, connector_pool_size)
|
5
9
|
super(registry)
|
6
10
|
|
7
11
|
if connector_pool_size > 1
|
12
|
+
log.info { "Host ConnectorSupervisor pool starting with size: #{connector_pool_size}" }
|
8
13
|
pool(HostConnector::SSH, size: connector_pool_size, as: :ssh)
|
9
14
|
pool(HostConnector::WinRM, size: connector_pool_size, as: :winrm)
|
10
15
|
else
|
@@ -21,6 +26,15 @@ module Ridley
|
|
21
26
|
PORT_CHECK_TIMEOUT = 3
|
22
27
|
RETRY_COUNT = 3
|
23
28
|
|
29
|
+
CONNECTOR_PORT_ERRORS = [
|
30
|
+
Errno::ETIMEDOUT, Timeout::Error, SocketError,
|
31
|
+
Errno::ECONNREFUSED, Errno::EHOSTUNREACH, Errno::EADDRNOTAVAIL
|
32
|
+
]
|
33
|
+
|
34
|
+
if Buff::RubyEngine.jruby?
|
35
|
+
CONNECTOR_PORT_ERRORS << Java::JavaNet::ConnectException
|
36
|
+
end
|
37
|
+
|
24
38
|
finalizer :finalize_callback
|
25
39
|
|
26
40
|
def initialize(connector_pool_size=nil)
|
@@ -226,7 +240,7 @@ module Ridley
|
|
226
240
|
defer {
|
227
241
|
Timeout.timeout(wait_time || PORT_CHECK_TIMEOUT) { Celluloid::IO::TCPSocket.new(host, port).close; true }
|
228
242
|
}
|
229
|
-
rescue
|
243
|
+
rescue *CONNECTOR_PORT_ERRORS => ex
|
230
244
|
@retry_count -= 1
|
231
245
|
retry if @retry_count > 0
|
232
246
|
false
|