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

xdsclient: fix race in load report implementation #5927

Merged
merged 1 commit into from Jan 13, 2023

Conversation

easwars
Copy link
Contributor

@easwars easwars commented Jan 12, 2023

In clientImpl.ReportLoad(), once we get a reference to the appropriate authority object, we are supposed to increment the reference count using a call to authority.refLocked().

The documentation on this function says:

// Increments the reference count. Caller must hold parent's authorityMu.

We were releasing the mutex right before incrementing the reference count, and this was not caught by any of our unit tests. It was only caught when I ran a prober binary with the race flag enabled.

RELEASE NOTES:

  • xdsclient: fix race which can happen when multiple load reporting calls are made at the same time.

@easwars easwars requested a review from dfawley January 12, 2023 02:08
@easwars easwars added this to the 1.53 Release milestone Jan 12, 2023
@dfawley dfawley assigned easwars and unassigned dfawley Jan 13, 2023
@easwars easwars merged commit 78ddc05 into grpc:master Jan 13, 2023
1 check passed
@easwars easwars deleted the xds_clientimpl_loadreport_race branch January 13, 2023 18:25
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 13, 2023
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

2 participants