Skip to content

Commit

Permalink
clientconn: fix potential deadlock caused by ResetConnectBackoff (#3051)
Browse files Browse the repository at this point in the history
  • Loading branch information
dfawley committed Sep 27, 2019
1 parent 1950dc9 commit e351044
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions clientconn.go
Expand Up @@ -875,8 +875,9 @@ func (cc *ClientConn) resolveNow(o resolver.ResolveNowOption) {
// This API is EXPERIMENTAL.
func (cc *ClientConn) ResetConnectBackoff() {
cc.mu.Lock()
defer cc.mu.Unlock()
for ac := range cc.conns {
conns := cc.conns
cc.mu.Unlock()
for ac := range conns {
ac.resetConnectBackoff()
}
}
Expand Down

0 comments on commit e351044

Please sign in to comment.