-
Notifications
You must be signed in to change notification settings - Fork 272
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
Handle on waiting #1562
base: master
Are you sure you want to change the base?
Handle on waiting #1562
Conversation
Aligns spawner and unspawner logic
Co-authored-by: Christoph Fröhlich <[email protected]>
for controller_name in controller_names: | ||
fallback_controllers = args.fallback_controllers | ||
controller_type = args.controller_type | ||
prefixed_controller_name = controller_name | ||
if controller_namespace: | ||
prefixed_controller_name = controller_namespace + "/" + controller_name | ||
|
||
if is_controller_loaded(node, controller_manager_name, prefixed_controller_name): | ||
if is_controller_loaded( | ||
node, controller_manager_name, prefixed_controller_name, timeout |
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.
timeout seems not to be defined here.
@@ -225,7 +175,6 @@ def main(args=None): | |||
controller_manager_name = args.controller_manager | |||
controller_namespace = args.namespace | |||
param_file = args.param_file | |||
controller_manager_timeout = args.controller_manager_timeout |
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.
That line would need to stay probably
if not cli.wait_for_service(service_timeout): | ||
raise RuntimeError(f"Could not contact service {service_name}") | ||
while not cli.service_is_ready(): | ||
node.get_logger().debug(f"waiting for service {service_name} to become available...") |
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 should probably be an info and not a debug. If the spawner hangs there users should know.
I tested this PR locally and managed to end up in a deadlock here, which is basically why I went for this approach in my PR. I realized that I can reproduce this quite regularly when restarting my robot bringup right after stopping 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.
I think we should also jump out after some number of attempts
if not cli.wait_for_service(service_timeout): | ||
raise RuntimeError(f"Could not contact service {service_name}") | ||
while not cli.service_is_ready(): | ||
node.get_logger().debug(f"waiting for service {service_name} to become available...") |
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 think we should also jump out after some number of attempts
This pull request is in conflict. Could you fix it @bmagyar? |
We tested this PR (adding back in line 228 in controller_manager/controller_manager/spawner.py) and we were able to run ros2_control over a FastDDS discovery server. |
Conflict resolved from #1483