- New
auto_reload_after_fork
config option to disable auto-drop [#177, shayonj]
- Automatically drop all connections after fork [#166]
- Minimum Ruby version is now 2.5.0
- Add pool size to TimeoutError message
- Fix argument forwarding on Ruby 2.7 [#149]
- Add
reload
to close all connections, recreating them afterwards [Andrew Marshall, #140] - Add
then
as a way to use a pool or a bare connection with the same code path [#138]
- Pool now throws
ConnectionPool::TimeoutError
on timeout. [#130] - Use monotonic clock present in all modern Rubies [Tero Tasanen, #109]
- Remove code hacks necessary for JRuby 1.7
- Expose wrapped pool from ConnectionPool::Wrapper [Thomas Lecavelier, #113]
- Add pool
size
andavailable
accessors for metrics and monitoring purposes [#97, robholland]
- Allow CP::Wrapper to use an existing pool [#87, etiennebarrie]
- Use monotonic time for more accurate timeouts [#84, jdantonio]
- Rollback
Timeout
handling introduced in 2.1.1 and 2.1.2. It seems impossible to safely work around the issue. Please never, ever useTimeout.timeout
in your code or you will see rare but mysterious bugs. [#75]
- Don't increment created count until connection is successfully created. [mylesmegyesi, #73]
- The connection_pool will now close any connections which respond to
close
(Dalli) ordisconnect!
(Redis). This ensures discarded connections from the fix in 2.1.1 are torn down ASAP and don't linger open.
- Work around a subtle race condition with code which uses
Timeout.timeout
and checks out a connection within the timeout block. This might cause connections to get into a bad state and raise very odd errors. [tamird, #67]
- Refactoring to better support connection pool subclasses [drbrain, #55]
with
should return value of the last expression [#59]
- The connection pool is now lazy. Connections are created as needed and retained until the pool is shut down. [drbrain, #52]
- Add
with(options)
andcheckout(options)
. [mattcamuto] Allows the caller to override the pool timeout.
@pool.with(:timeout => 2) do |conn|
end
-
New
#shutdown
method (simao)This method accepts a block and calls the block for each connection in the pool. After calling this method, trying to get a connection from the pool raises
PoolShuttingDownError
.
-
#with_connection
is now gone in favor of#with
. -
We no longer pollute the top level namespace with our internal
TimedStack
class.
-
#with_connection
is now deprecated in favor of#with
.A warning will be issued in the 0.9 series and the method will be removed in 1.0.
-
We now reuse objects when possible.
This means that under no contention, the same object will be checked out from the pool after subsequent calls to
ConnectionPool#with
.This change should have no impact on end user performance. If anything, it should be an improvement, depending on what objects you are pooling.
- Fix reentrant checkout leading to early checkin.
- Fix invalid superclass in version.rb
- Move method_missing magic into ConnectionPool::Wrapper (djanowski)
- Remove BasicObject superclass (djanowski)
- More precise timeouts and better error message
- ConnectionPool now subclasses BasicObject so
method_missing
is more effective.