-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
connection pool timeout - not reconnect #3289
Comments
Hello @parsibox , what is the |
30 |
redis-server version? |
I also encountered an issue where connection pool timeouts were not subject to retries.
opts, _ := redis.ParseURL(url)
opts.DialTimeout = 1 * time.Second
opts.ReadTimeout = 1 * time.Second
opts.WriteTimeout = 1 * time.Second
opts.MaxRetries = 2 I suspect that the reason connection pool timeouts are not being retried is as follows: |
Indeed, this error was overlooked, and it can be fixed. |
|
Redis Version: 7.0.11 |
It is observed that you are using the latest version of go-redis and encountered the error "redis: connection pool timeout." This error corresponds to ErrPoolTimeout in go-redis (ErrPoolTimeout timed out waiting to get a connection from the connection pool), indicating that go-redis timed out while trying to obtain a connection from the connection pool. This suggests that there are no available connections in the pool, and the PoolSize limit has been reached. The timeout duration depends on opt.PoolTimeout (if not set, it defaults to ReadTimeout + 1s). |
i only first run a script in redis and that was heavy then i restart redis after that my redis pool connection get connection pool timeout |
or maybe there is a bug in remove died connection from pool |
We cannot delete connections in the connection pool; they might be in use (or even in use for a long time), which is one of the connection pool's functions. Based on what you're describing, I believe heavy requests are causing the connection pool to be very busy. Am I understanding this correctly? |
Hey @parsibox, @monkey92t — I'd like to look into contributing here. I'm particularly interested in improving the robustness of the connection pool logic, specifically around handling timeouts, reconnect attempts, and stale connection management. I've reviewed the discussion above and the details provided, and I'm ready to dig deeper into this. If there are specific areas of the codebase you think would benefit most from attention, please let me know. Otherwise, I'll start by investigating the handling of ErrPoolTimeout in the retry and connection pool logic. Looking forward to helping here! |
@parsibox could you be able to test with the latest 9.8.0-beta.1 ? |
hi
i use go 1.23 on linux 64 bit
today my redis has a problem and i restarted that but my golang code have error and not reconnected
this is my code
i get error :
redis: connection pool timeout
why pool connection not renew?or not reconnect again?after i restarted my code it work !!!
The text was updated successfully, but these errors were encountered: