Skip to content

xdsclient: fix race in load report implementation#5927

Merged
easwars merged 1 commit into
grpc:masterfrom
easwars:xds_clientimpl_loadreport_race
Jan 13, 2023
Merged

xdsclient: fix race in load report implementation#5927
easwars merged 1 commit into
grpc:masterfrom
easwars:xds_clientimpl_loadreport_race

Conversation

@easwars

@easwars easwars commented Jan 12, 2023

Copy link
Copy Markdown
Contributor

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
@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.

2 participants