Skip to content

Allow connection_pool 3.x - #46

Open
yasaichi wants to merge 1 commit into
statsig-io:mainfrom
yasaichi:fix/allow-connection-pool-3
Open

Allow connection_pool 3.x#46
yasaichi wants to merge 1 commit into
statsig-io:mainfrom
yasaichi:fix/allow-connection-pool-3

Conversation

@yasaichi

@yasaichi yasaichi commented Sep 3, 2026

Copy link
Copy Markdown

Summary

Relax the connection_pool dependency to allow 3.x releases.

The current constraint (~> 2.4, >= 2.4.1) excludes connection_pool 3.x even though the APIs used by Statsig remain compatible. It also prevents Statsig from being installed alongside libraries that require 3.x, including Sidekiq 8.1.

Compatibility

Statsig currently uses:

  • ConnectionPool.new(size: ...)
  • ConnectionPool#with
  • ConnectionPool#discard_current_connection
  • ConnectionPool#shutdown

These APIs are compatible with Statsig's usage in both connection_pool 2.5.x and 3.x. Version 3 changed some positional arguments to keyword arguments, but Statsig does not use the affected forms and already passes size: as a keyword.

Minimum version

Statsig currently declares support for connection_pool 2.4.1, but the SDK calls discard_current_connection, which was added in 2.5.4.

The dependency is therefore changed to:

s.add_runtime_dependency 'connection_pool', '>= 2.5.4', '< 4.0'

This keeps Ruby 2.5 compatibility through connection_pool 2.5.x while allowing Ruby 3.2+ applications to resolve 3.x.

Validation

  • Ruby 2.5.9 with connection_pool 2.5.4: test suite passed, excluding the credentialed live CountryLookupTest#test_lookup.
  • Ruby 3.4.10 with connection_pool 3.0.2: test suite passed, excluding the credentialed live CountryLookupTest#test_lookup.
  • The final connection-discard regression passed on both dependency branches (1 test, 5 assertions each).

The existing 2.x-only constraint excludes a compatible major version
even though the SDK's current API usage remains compatible with 3.x.

Raise the minimum to the first release that can discard broken
connections so the declared dependency also matches the current error
path.
@yasaichi
yasaichi force-pushed the fix/allow-connection-pool-3 branch from 00e42f5 to f27639a Compare September 3, 2026 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant