Commit Graph

15 Commits

Author SHA1 Message Date
Sihyeon Jang f59da361f1 feat: Re-use Redis connection pools via local cache to prevent transient exhaustion
Every call to get_redis_connection() spawned a new pool, so workers slowly accumulated thousands of open sockets. Even though connections were eventually released, skewed release timing still pushed us past Redis’ max-clients and the cluster egress IP cap.

A module-level _CONNECTION_CACHE now memoises pools by (redis_url, sentinel_hosts, async_mode, decode_responses).

Result: flat connection count, no more IP or FD exhaustion. Public API unchanged.

Signed-off-by: Sihyeon Jang <sihyeon.jang@navercorp.com>
2025-07-24 18:44:42 +09:00
Sihyeon Jang 9067eac4ca chore: add log for redis.exceptions
Signed-off-by: Sihyeon Jang <sihyeon.jang@navercorp.com>
2025-07-16 15:23:18 +09:00
Sihyeon Jang 65882c30cb refactor: change MAX_RETRY_COUNT as env
Signed-off-by: Sihyeon Jang <sihyeon.jang@navercorp.com>
2025-07-16 15:23:18 +09:00
Sihyeon Jang 1b7ac7c739 chore: format, lint
Signed-off-by: Sihyeon Jang <sihyeon.jang@navercorp.com>
2025-07-16 15:23:18 +09:00
Sihyeon Jang 423d0923d9 feat: add Redis Sentinel failover support for high availability
- Implement SentinelRedisProxy class with automatic master discovery
- Add retry logic for handling connection failures and read-only errors
- Support both async and sync Redis operations with Sentinel
- Ensure backward compatibility with existing Redis configurations
- Provide seamless failover during master node outages

This enhancement significantly improves system reliability by eliminating
single points of failure in Redis deployments and ensuring continuous
service availability during infrastructure issues.

Signed-off-by: Sihyeon Jang <sihyeon.jang@navercorp.com>
2025-07-16 15:23:17 +09:00
Timothy Jaeryang Baek db3c26ab7a refac: async redis 2025-06-09 15:37:05 +04:00
Timothy Jaeryang Baek 0c57980e72 refac: tasks 2025-06-08 20:58:31 +04:00
Timothy Jaeryang Baek 91a455a284 chore: format 2025-04-12 16:35:11 -07:00
Jan Kessler 257ca45456
leave out @ in redis+sentine url when no username/password is provided 2025-04-03 08:24:24 +02:00
Jan Kessler 35ea29b184
prepare websocket redis sentinel code for upcoming native support of sentinel in python-socketio 2025-04-02 21:50:00 +02:00
Timothy Jaeryang Baek 1ac87c55ff chore: format 2025-03-28 11:47:14 -07:00
Jan Kessler 0615c11a53
fix sentinel connection being attempted for non-sentinel redis 2025-03-27 10:23:35 +01:00
Jan Kessler d0b13cf388
prefix sentinel envs with redis_ 2025-03-27 09:22:11 +01:00
Jan Kessler e68cd9b671
Redis Sentinel support for AppConfig 2025-03-18 09:30:18 +01:00
Jan Kessler 9167a8bef0
refac as prep for sentinel support in AppConfig 2025-03-18 08:44:50 +01:00