mirror of
https://github.com/redis/go-redis.git
synced 2025-07-18 00:20:57 +03:00
feat: fix connection health check interference with push notifications
- Add PushNotificationProcessor field to pool.Conn for connection-level processing - Modify connection pool Put() and isHealthyConn() to handle push notifications - Process pending push notifications before discarding connections - Pass push notification processor to connections during creation - Update connection pool options to include push notification processor - Add comprehensive test for connection health check integration This prevents connections with buffered push notification data from being incorrectly discarded by the connection health check, ensuring push notifications are properly processed and connections are reused.
This commit is contained in:
8
redis.go
8
redis.go
@ -767,11 +767,17 @@ func NewClient(opt *Options) *Client {
|
||||
},
|
||||
}
|
||||
c.init()
|
||||
c.connPool = newConnPool(opt, c.dialHook)
|
||||
|
||||
// Initialize push notification processor
|
||||
c.initializePushProcessor()
|
||||
|
||||
// Update options with the initialized push processor for connection pool
|
||||
if c.pushProcessor != nil {
|
||||
opt.PushNotificationProcessor = c.pushProcessor
|
||||
}
|
||||
|
||||
c.connPool = newConnPool(opt, c.dialHook)
|
||||
|
||||
return &c
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user