Skip to content

Conversation

alpaca-tc
Copy link

@alpaca-tc alpaca-tc commented Sep 26, 2024

When pool_size or pool_timeout is passed as an option, Redis::Rack::Connection builds a ConnectionPool. ConnectionPool will execute a given block when there are not enough connections. However, since the calling store is cached in an instance variable, all connections held by the ConnectionPool are actually same objects.

It seems like something fatal would occur, but since there are no reports in the issues, maybe the existing implementation is no problem.

NOTE: This bug does not affect the following users:

  • Users who specify threadsafe: true.
  • Users who do not pass the threadsafe option.
  • Users who directly pass the pool as options, such as { pool: ConnectionPool.new(...) }.

When `pool_size` or `pool_timeout` is passed as an option, `Redis::Rack::Connection` builds a `ConnectionPool`.
`ConnectionPool` will execute a given block when there are not enough connections. However, since the calling store is cached in an instance variable, all connections held by the `ConnectionPool` are actually same objects.
@alpaca-tc alpaca-tc requested a review from tubbo as a code owner September 26, 2024 09:18
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