-
Notifications
You must be signed in to change notification settings - Fork 225
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
Wake executor when entities created or destroyed #336
Conversation
06e60b2
to
2b611a0
Compare
Proof that tests fail without 2b611a0
|
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, with one question, looks like flake8 is failing.
@@ -210,6 +210,11 @@ def executor(self, new_executor: Executor) -> None: | |||
new_executor.add_node(self) | |||
self.__executor_weakref = weakref.ref(new_executor) | |||
|
|||
def _wake_executor(self): | |||
executor = self.executor |
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.
This seems unnecessary, is there a reason for it?
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.
vs
if self.executor:
self.executor.wake()
self.executor
is a property that is set to None
when the node is removed from an executor. If the node is removed after the check then the call to wake
might raise AttributeError
Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
67718c2
to
020cf7c
Compare
CI (testing just rclpy after rebasing on master)
Edit: WIll re-run windows CI post API freeze |
Replaces #206
Fixes #188
This wakes the executor when entities are created or destroyed. I added tests for creating entities waking the executor, but I haven't figured out how to add tests for destroying entities waking the executor.
This was unblocked by #308 which made it possible to write a test for creating entities.