-
Notifications
You must be signed in to change notification settings - Fork 65
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
Synchronize Spot leasing #298
Conversation
@@ -220,7 +218,7 @@ def __init__(self, parameter_list: Optional[typing.List[Parameter]] = None, **kw | |||
self.callbacks["lease"] = self.lease_callback | |||
self.callbacks["world_objects"] = self.world_objects_callback | |||
|
|||
self.group: CallbackGroup = ReentrantCallbackGroup() | |||
self.group: CallbackGroup = MutuallyExclusiveCallbackGroup() |
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.
I have not thoroughly analyzed the implications of this change yet. If this is too conservative, we may have to synchronize closer to SpotWrapper
call sites.
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.
Circling back to this. I experienced some hangs during testing, which went away after applying 7be4791, which removes callbacks that need not share a callback group from the main, now mutually exclusive, callback group.
Pull Request Test Coverage Report for Build 8190131069Details
💛 - Coveralls |
Signed-off-by: Michel Hidalgo <[email protected]>
eaab6a6
to
e9aedba
Compare
Signed-off-by: Michel Hidalgo <[email protected]>
Signed-off-by: Michel Hidalgo <[email protected]>
@amessing-bdai PTAL |
Signed-off-by: Michel Hidalgo <[email protected]>
Change Overview
SpotWrapper
is not thread-safe, and thus reentrant ROS 2 callbacks risk resource contention. This patch synchronizesSpotWrapper
use in general, and lease management in particular, by making all ROS 2 callbacks mutually exclusive.It also makes use of bdaiinstitute/spot_wrapper#92 to avoid reaching out to
SpotWrapper
internals.Testing Done
In addition to green CI, I manually ran multiple examples on a real Spot (those in this repository and others in downstream repositories as well).