-
Notifications
You must be signed in to change notification settings - Fork 912
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
api: WaitForUpdatesEx & DestroyPropertyFilter #3331
api: WaitForUpdatesEx & DestroyPropertyFilter #3331
Conversation
14d5c45
to
5a43f74
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @akutz
The new property.WaitForUpdatesEx lgtm.
Keep in mind ServiceContent.PropertyCollector
(aka property.DefaultCollector()) is a session singleton, not safe for multiple threads to WaitForUpdatesEx on.
object.Task.{Wait,WaitForResult} and the new Ex versions both use DefaultCollector.Create(), so the Ex version(s) are not thread safe.
Thinking:
- leave the existing
object.Task
methods as-is - change
task.Wait
to always use property.WaitForUpdatesEx, rather than add task.WaitEx (don't think anyone currently calls task.Wait directly?) - then apps would call
task.Wait
to re-use a PC instance
property.Filter - tempted to do a breaking rename of the existing type, to property.Match or ?
Then property.Filter can be used to wrap the MO instead of FilterEx
Hi @dougm , Thanks for taking a look. Yeah, the concurrency thing is an issue. What are your thoughts on starting
That way there's always a single, long-running WaitForUpdates goroutine that can be used to listen for all updates, whenever there's a prop filter added? |
5a43f74
to
6201145
Compare
Hey @dougm, Please see the refactored PR. I added a lock to the |
dca80e4
to
9914a6d
Compare
d6acfa8
to
8be3adb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @akutz , can you also add a BREAKING:
section to the commit? Suggesting one more for the list (CreateFilter)
12a6037
to
5ea7ac5
Compare
This patch introduces Ex variants for many of the property collector types/methods to take advantage of the remote API DestroyPropertyFilter. Now it is possible to use a single property collector for waiting for updates and remove previously added property filters. BREAKING: The semantics around the helper functions in the property package have changed. Please review any code that calls this package to ensure it is compatible with the new behaviors.
5ea7ac5
to
95aa257
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thanks @akutz !
In the PR vmware#3331 refactor WaitOptions was changed to pass by value, rather than reference. The Truncated value needs to be propagated from WaitForUpdatesEx response to the caller. Fixes vmware#3501
In the PR vmware#3331 refactor WaitOptions was changed to pass by value, rather than reference. The Truncated value needs to be propagated from WaitForUpdatesEx response to the caller. Fixes vmware#3501
Description
This patch introduces Ex variants for many of the property collector types/methods to take advantage of the remote API DestroyPropertyFilter. Now it is possible to use a single property collector for waiting for updates and remove previously added filters.
Closes:
NA
Type of change
Please mark options that are relevant:
How Has This Been Tested?
property.WaitForUpdatesEx
property.Collector
'sWaitForUpdatesEx
functionDestroyPropertyFilter
Checklist:
CONTRIBUTION
guidelines of this project