Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

always close pool connections to avoid zlib warnings #457

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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