Skip to content

Conversation

@nvorobev
Copy link
Contributor

@nvorobev nvorobev commented Nov 1, 2023

This library implements non-standard pool behavior. Where the pool size is essentially not an honest pool size and can increase without limitation, which under heavy loads will lead to the server being flooded with connections.

PoolSizeStrict - enabling classic pool mode, when it is guaranteed that no more connections will open to the server than specified in PoolSize.

An example of classic pool behavior:

https://github.com/gomodule/redigo/blob/master/redis/pool.go#L147C1-L147C1

https://github.com/gomodule/redigo/blob/master/redis/pool.go#L247

@nvorobev nvorobev changed the title newConn race fix newConn race fix, replacing the MaxActiveConns parameter with PoolSizeStrict Nov 3, 2023
@nvorobev nvorobev changed the title newConn race fix, replacing the MaxActiveConns parameter with PoolSizeStrict newConn race fix, fix check pool exhausted, replacing the MaxActiveConns parameter with PoolSizeStrict Nov 3, 2023
@ofekshenawa
Copy link
Collaborator

@nvorobev Could you please add unit tests for this issue?

@ndyakov
Copy link
Member

ndyakov commented Mar 19, 2025

@nvorobev thank you for the contribution, please add tests so we can review the PR and proceed.

Comment on lines +182 to +187
// It is not allowed to add new connections to the closed connection pool.
if p.closed() {
_ = cn.Close()
return nil, ErrClosed
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should check if pool is closed before potential dialconn call.

@ndyakov
Copy link
Member

ndyakov commented Sep 2, 2025

It has been couple of months, closing this as stale PR. @nvorobev feel free to open a new one based on the latest state of master.

@ndyakov ndyakov closed this Sep 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants