Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix concurrent map access in endpoint metadata #44473

Merged
merged 9 commits into from
Apr 26, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add lock
Signed-off-by: Rama Chavali <rama.rao@salesforce.com>
  • Loading branch information
ramaraochavali committed Apr 26, 2023
commit 0570f8f0e32b4904877ba8cdd25cc27af127e202
Original file line number Diff line number Diff line change
Expand Up @@ -1703,9 +1703,13 @@ func TestConcurrentBuildLocalityLbEndpoints(t *testing.T) {
wg := sync.WaitGroup{}
wg.Add(5)
var actual []*endpoint.LocalityLbEndpoints
mu := sync.Mutex{}
for i := 0; i < 5; i++ {
go func() {
actual = cb.buildLocalityLbEndpoints(view, service, 8080, lbls)
eps := cb.buildLocalityLbEndpoints(view, service, 8080, lbls)
mu.Lock()
actual = eps
mu.Unlock()
wg.Done()
}()
}
Expand Down