remotus 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/.rubocop.yml +1 -1
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/lib/remotus/ssh_connection.rb +9 -1
- data/lib/remotus/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e6b07dbe42ab741bdb688bed9f6ce1d09ed2af8643291c57ec9aeedaaad0a19a
|
4
|
+
data.tar.gz: a39ecf434564157c1e72d98cf840abadc1a406f91988ee7c47cf7c22d9643760
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f48c3e374b870a60664cf35838204755a83599a534113309abfecb40e5a5862f10091bd7bc19d8353a8a5716c71fe02dea043f891db998dd521451a998be4419
|
7
|
+
data.tar.gz: 0c3d1f3e5dfbae5c2aeaec9d18f3eb4f4b99759b4c883e3298691e7cad7a91fa71d03f595cffb9bab07f9191844284a211c5fb76ff7900af56791ea6ed9a6f2a
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
## [1.1.0] - 2023-05-25
|
2
|
+
* Improve exponential backoff during SSH retries.
|
3
|
+
* Force connection close on IOError (closed stream).
|
4
|
+
|
1
5
|
## [1.0.0] - 2023-04-25
|
2
6
|
* Update SSH dependencies to handle `pkeys are immutable on OpenSSL 3.0` errors on newer Ruby versions
|
3
7
|
* Remove Ruby 2.5 support
|
data/Gemfile.lock
CHANGED
@@ -20,7 +20,7 @@ module Remotus
|
|
20
20
|
KEEPALIVE_INTERVAL = 300
|
21
21
|
|
22
22
|
# Number of default retries
|
23
|
-
DEFAULT_RETRIES =
|
23
|
+
DEFAULT_RETRIES = 8
|
24
24
|
|
25
25
|
# Base options for new SSH connections
|
26
26
|
BASE_CONNECT_OPTIONS = { non_interactive: true, keepalive: true, keepalive_interval: KEEPALIVE_INTERVAL }.freeze
|
@@ -424,6 +424,8 @@ module Remotus
|
|
424
424
|
# @param [Integer] retries number of retries
|
425
425
|
#
|
426
426
|
def with_retries(command, retries)
|
427
|
+
sleep_time = 1
|
428
|
+
|
427
429
|
yield if block_given?
|
428
430
|
rescue Remotus::AuthenticationError, Net::SSH::AuthenticationFailed => e
|
429
431
|
# Re-raise exception if the retry count is exceeded
|
@@ -446,6 +448,12 @@ module Remotus
|
|
446
448
|
retries -= 1
|
447
449
|
raise if e.to_s != "closed stream" || retries.negative?
|
448
450
|
|
451
|
+
# Close the existing connection before retrying again
|
452
|
+
close
|
453
|
+
|
454
|
+
Remotus.logger.debug { "Sleeping for #{sleep_time} seconds before next retry..." }
|
455
|
+
sleep sleep_time
|
456
|
+
sleep_time *= 2 # Double delay for each retry
|
449
457
|
retry
|
450
458
|
end
|
451
459
|
|
data/lib/remotus/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: remotus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthew Newell
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-05-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: connection_pool
|