Skip to content

Commit

Permalink
[xds_client_lock] xds/client: hold authority mutex before making a ne…
Browse files Browse the repository at this point in the history
…w authority
  • Loading branch information
menghanl committed Apr 29, 2022
1 parent dc86d5d commit a428cd3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions xds/internal/xdsclient/loadreport.go
Expand Up @@ -28,7 +28,9 @@ import (
// It returns a Store for the user to report loads, a function to cancel the
// load reporting stream.
func (c *clientImpl) ReportLoad(server *bootstrap.ServerConfig) (*load.Store, func()) {
c.authorityMu.Lock()
a, err := c.newAuthority(server)
c.authorityMu.Unlock()
if err != nil {
c.logger.Infof("xds: failed to connect to the control plane to do load reporting for authority %q: %v", server, err)
return nil, func() {}
Expand Down

0 comments on commit a428cd3

Please sign in to comment.