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

internal/balancergroup: eliminate race in exitIdle #5012

Merged
merged 2 commits into from Dec 7, 2021

Conversation

easwars
Copy link
Contributor

@easwars easwars commented Nov 29, 2021

incomingMu needs to be taken before accessing scToSubBalancer map as part of exitIdle

RELEASE NOTES: n/a

@easwars easwars added this to the 1.43 release milestone Nov 29, 2021
@easwars
Copy link
Contributor Author

easwars commented Nov 29, 2021

I couldn't come up with a unit test for this. Please let me know if you have any ideas. Thanks.

Copy link
Contributor

@menghanl menghanl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make two goroutines with loops, one calls UpdateSubConnState, the other calls ExitIdle?
Without incoming mu, the two goroutines should race.

@menghanl menghanl assigned easwars and unassigned menghanl Nov 30, 2021
sc.Connect()
}
}
sbc.group.connect(sbc)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the balancer group calls into the wrapper calls back into the group?

Would it be better to put all this logic in the group's ExitIdle function, then? Or return a bool and have ExitIdle do the connect work?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@easwars easwars merged commit f5dc086 into grpc:master Dec 7, 2021
@easwars easwars deleted the bg_race branch December 7, 2021 18:04
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants