Skip to content

Commit

Permalink
always close pool connections to avoid zlib warnings
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
eatwithforks committed Mar 5, 2019
1 parent a703af2 commit 96733fa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ appear at the top.
## [Unreleased][]

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

## [1.18.2][] (2019-02-03)
Expand Down
5 changes: 2 additions & 3 deletions lib/sshkit/backends/netssh.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,9 @@ def download!(remote, local=nil, options = {})

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

class << self
attr_accessor :pool
Expand Down

0 comments on commit 96733fa

Please sign in to comment.