Skip to content

Commit 6c852d0

Browse files
committed
add lock/unlock for autodiscovery provider
Signed-off-by: Roy Chiang <[email protected]>
1 parent 22ed612 commit 6c852d0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/discovery/memcache/provider.go

+3
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ func (p *Provider) Resolve(ctx context.Context, addresses []string) error {
101101

102102
// Addresses returns the latest addresses present in the Provider.
103103
func (p *Provider) Addresses() []string {
104+
p.RLock()
105+
defer p.RUnlock()
106+
104107
var result []string
105108
for _, config := range p.clusterConfigs {
106109
for _, node := range config.nodes {

0 commit comments

Comments
 (0)