chore: don't guard connection settings with the registry mutex (#32695)
This commit is contained in:
parent
136809f9b0
commit
232d367461
1 changed files with 9 additions and 9 deletions
|
|
@ -104,7 +104,7 @@ type meterConnection struct {
|
|||
proto Protocol
|
||||
refs int // count of references; first connection has ref count 0
|
||||
|
||||
// largest value requested by any of the sharing logical connections
|
||||
mu sync.Mutex
|
||||
delay time.Duration
|
||||
connectDelay time.Duration
|
||||
timeout time.Duration
|
||||
|
|
@ -114,23 +114,23 @@ type meterConnection struct {
|
|||
|
||||
// setDelay applies the delay if larger than the current value
|
||||
func (c *meterConnection) setDelay(delay time.Duration) {
|
||||
mu.Lock()
|
||||
defer mu.Unlock()
|
||||
c.mu.Lock()
|
||||
defer c.mu.Unlock()
|
||||
|
||||
c.delay = max(c.delay, delay)
|
||||
}
|
||||
|
||||
func (c *meterConnection) getDelay() time.Duration {
|
||||
mu.Lock()
|
||||
defer mu.Unlock()
|
||||
c.mu.Lock()
|
||||
defer c.mu.Unlock()
|
||||
|
||||
return c.delay
|
||||
}
|
||||
|
||||
// setConnectDelay applies the connect delay if larger than the current value
|
||||
func (c *meterConnection) setConnectDelay(delay time.Duration) {
|
||||
mu.Lock()
|
||||
defer mu.Unlock()
|
||||
c.mu.Lock()
|
||||
defer c.mu.Unlock()
|
||||
|
||||
if delay > c.connectDelay {
|
||||
c.connectDelay = delay
|
||||
|
|
@ -140,8 +140,8 @@ func (c *meterConnection) setConnectDelay(delay time.Duration) {
|
|||
|
||||
// setTimeout applies the timeout if larger than the current value
|
||||
func (c *meterConnection) setTimeout(timeout time.Duration) {
|
||||
mu.Lock()
|
||||
defer mu.Unlock()
|
||||
c.mu.Lock()
|
||||
defer c.mu.Unlock()
|
||||
|
||||
if timeout > c.timeout {
|
||||
c.timeout = timeout
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue