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

Handle on waiting #1562

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Handle on waiting #1562

wants to merge 9 commits into from

Conversation

bmagyar
Copy link
Member

@bmagyar bmagyar commented Jun 5, 2024

Conflict resolved from #1483

@bmagyar bmagyar mentioned this pull request Jun 5, 2024
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
Copy link
Contributor

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
Copy link
Contributor

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...")
Copy link
Contributor

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.

Copy link
Member

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...")
Copy link
Member

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

Copy link
Contributor

mergify bot commented Jun 25, 2024

This pull request is in conflict. Could you fix it @bmagyar?

@wittenator
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants