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

Fix Disabling of Connection Pool #448

Merged
merged 4 commits into from
Jan 30, 2019
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ appear at the top.

## [Unreleased][]

* Your contribution here!
* [#448](https://github.com/capistrano/sshkit/pull/448): Fix misbehaving connection eviction loop when disabling connection pooling - [Sebastian Cohnen](https://github.com/tisba)
tisba marked this conversation as resolved.
Show resolved Hide resolved

## [1.18.1][] (2019-01-26)

Expand Down
6 changes: 5 additions & 1 deletion lib/sshkit/backends/connection_pool.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ def initialize(idle_timeout=30)
@caches = {}
@caches.extend(MonitorMixin)
@timed_out_connections = Queue.new
Thread.new { run_eviction_loop }

# Spin up eviction loop only if caching is enabled
if cache_enabled?
Thread.new { run_eviction_loop }
end
end

# Creates a new connection or reuses a cached connection (if possible) and
Expand Down