Skip to content

Commit

Permalink
Switch default connection pool to timed_queue on Ruby 3.4+
Browse files Browse the repository at this point in the history
This gives about a whole year for Sequel users to test this with
Ruby 3.4 previews, and it ensures Sequel will not switch the
connection pool type for anything using a released version of
Ruby.

Assuming no problems are reported, in Sequel 6, or potentially
earlier, we'll switch this from 3.4+ to 3.2+.
  • Loading branch information
jeremyevans committed Jan 4, 2024
1 parent 45efcc6 commit e22d633
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
=== master

* Switch default connection pool to timed_queue on Ruby 3.4+ (jeremyevans)

* Support on_duplicate_columns={raise,warn} parameter in connection URL when using duplicate_columns_handler extension (jeremyevans)

* Add transaction_connection_validator extension for retrying transactions on new connection if ther is a disconnect error when starting transaction (jeremyevans)
Expand Down
6 changes: 4 additions & 2 deletions lib/sequel/connection_pool.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,10 @@ def connection_pool_class(opts)
else
pc = if opts[:single_threaded]
opts[:servers] ? :sharded_single : :single
#elsif RUBY_VERSION >= '3.2' # SEQUEL6 or maybe earlier
# opts[:servers] ? :sharded_timed_queue : :timed_queue
# :nocov:
elsif RUBY_VERSION >= '3.4' # SEQUEL6 or maybe earlier switch to 3.2
opts[:servers] ? :sharded_timed_queue : :timed_queue
# :nocov:
else
opts[:servers] ? :sharded_threaded : :threaded
end
Expand Down

0 comments on commit e22d633

Please sign in to comment.