Skip to content

Commit

Permalink
fire firstResolveEvent when done updating resolver state
Browse files Browse the repository at this point in the history
  • Loading branch information
dfawley committed Oct 3, 2019
1 parent bc703a8 commit 2aebcaa
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion balancer_conn_wrappers.go
Expand Up @@ -140,7 +140,6 @@ func (ccb *ccBalancerWrapper) watcher() {
ccb.UpdateBalancerState(connectivity.Connecting, nil)
return
}
ccb.cc.firstResolveEvent.Fire()
}
}

Expand Down
2 changes: 1 addition & 1 deletion clientconn.go
Expand Up @@ -556,6 +556,7 @@ func (cc *ClientConn) maybeApplyDefaultServiceConfig(addrs []resolver.Address) {
}

func (cc *ClientConn) updateResolverState(s resolver.State, err error) error {
defer cc.firstResolveEvent.Fire()
cc.mu.Lock()
// Check if the ClientConn is already closed. Some fields (e.g.
// balancerWrapper) are set to nil when closing the ClientConn, and could
Expand Down Expand Up @@ -600,7 +601,6 @@ func (cc *ClientConn) updateResolverState(s resolver.State, err error) error {
cc.blockingpicker.updatePicker(base.NewErrPicker(err))
cc.csMgr.updateState(connectivity.TransientFailure)
cc.mu.Unlock()
cc.firstResolveEvent.Fire()
return ret
}
}
Expand Down

0 comments on commit 2aebcaa

Please sign in to comment.