mirror of
https://github.com/redis/go-redis.git
synced 2025-07-29 17:41:15 +03:00
PubSub conns don't share connection pool limit
This commit is contained in:
@ -2,7 +2,6 @@ package redis
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"strings"
|
||||
"sync"
|
||||
@ -111,7 +110,7 @@ func (c *sentinelClient) PubSub() *PubSub {
|
||||
return &PubSub{
|
||||
base: baseClient{
|
||||
opt: c.opt,
|
||||
connPool: pool.NewStickyConnPool(c.connPool.(*pool.ConnPool), false),
|
||||
connPool: c.connPool,
|
||||
},
|
||||
}
|
||||
}
|
||||
@ -268,12 +267,11 @@ func (d *sentinelFailover) closeOldConns(newMaster string) {
|
||||
break
|
||||
}
|
||||
if cn.RemoteAddr().String() != newMaster {
|
||||
err := fmt.Errorf(
|
||||
internal.Logf(
|
||||
"sentinel: closing connection to the old master %s",
|
||||
cn.RemoteAddr(),
|
||||
)
|
||||
internal.Logf(err.Error())
|
||||
d.pool.Remove(cn, err)
|
||||
d.pool.Remove(cn)
|
||||
} else {
|
||||
cnsToPut = append(cnsToPut, cn)
|
||||
}
|
||||
|
Reference in New Issue
Block a user