Skip to content

Commit 96733fa

Browse files
committed
always close pool connections to avoid zlib warnings
previously, we only closed connections when there are no errors. when we hit errors while executing, we saw misleading zlib errors where instead it was just the ssh command failing. so lets always close connections to avoid those errors.
1 parent a703af2 commit 96733fa

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ appear at the top.
66
## [Unreleased][]
77

88
* Your contribution here!
9+
* [#457](https://github.com/capistrano/sshkit/pull/457): https://github.com/capistrano/sshkit/pull/457 - [@eatwithforks](https://github.com/eatwithforks)
910
* [#455](https://github.com/capistrano/sshkit/pull/455): Ensure UUID of commands are stable in logging - [@lazyatom](https://github.com/lazyatom)
1011

1112
## [1.18.2][] (2019-02-03)

lib/sshkit/backends/netssh.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,9 @@ def download!(remote, local=nil, options = {})
7979

8080
# Note that this pool must be explicitly closed before Ruby exits to
8181
# ensure the underlying IO objects are properly cleaned up. We register an
82-
# at_exit handler to do this automatically, as long as Ruby is exiting
83-
# cleanly (i.e. without an exception).
82+
# at_exit handler to do this automatically.
8483
@pool = SSHKit::Backend::ConnectionPool.new
85-
at_exit { @pool.close_connections if @pool && !$ERROR_INFO }
84+
at_exit { @pool.close_connections if @pool }
8685

8786
class << self
8887
attr_accessor :pool

0 commit comments

Comments
 (0)