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

vcsim: avoid ViewManager.ModifyListView race #2069

Merged
merged 2 commits into from
Jul 31, 2020

Conversation

dougm
Copy link
Member

@dougm dougm commented Jul 31, 2020

No description provided.

@dougm dougm added this to the 0.24 milestone Jul 31, 2020
@dougm dougm requested a review from mikekim July 31, 2020 04:14
Copy link
Contributor

@mikekim mikekim left a comment

Choose a reason for hiding this comment

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

lgtm.
I couldn't understand why this works and the other does not, though.

@dougm
Copy link
Member Author

dougm commented Jul 31, 2020

I'm not sure either. But Registry.WithLock is used to protect This by default when methods are invoked, such as the ListView instance when the ModifyListView method is invoked. The PropertyCollector also uses WithLock where appropriate. Registry has a [types.ManagedObjectReference]sync.Locker and the race this test produced was the read of mo.Reference.Reference(). I suppose the race detector may not know what happens behind that interface impl, unlike it does when we use the ListView.Self field directly. How we've avoided this problem with other objects, I don't know.

ref = obj.Reference()

@dougm dougm merged commit 6bae3ac into vmware:master Jul 31, 2020
@dougm dougm deleted the vcsim-list-view-race branch July 31, 2020 15:16
dougm added a commit to dougm/govmomi that referenced this pull request Sep 3, 2020
PR vmware#2069 attempted to fixed a race, but introduced a panic - missed because race_test.go did
not check the return error.
@dougm dougm mentioned this pull request Sep 3, 2020
marunachalam pushed a commit to marunachalam/govmomi that referenced this pull request Sep 14, 2020
PR vmware#2069 attempted to fixed a race, but introduced a panic - missed because race_test.go did
not check the return error.
marunachalam pushed a commit to marunachalam/govmomi that referenced this pull request Sep 14, 2020
PR vmware#2069 attempted to fixed a race, but introduced a panic - missed because race_test.go did
not check the return error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants