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

service client hangs on wait_for_service #661

Closed
huchhong opened this issue Mar 19, 2019 · 1 comment
Closed

service client hangs on wait_for_service #661

huchhong opened this issue Mar 19, 2019 · 1 comment

Comments

@huchhong
Copy link

Bug report

Required Info:

  • Operating System:
    • ubuntu 18.04
  • Installation type:
    • binary release of crystal

Steps to reproduce issue

I wrote a launch script to launch a service client and service server as listed below:

import os
from launch import LaunchDescription
import launch.actions
import launch_ros.actions


def generate_launch_description():
    return LaunchDescription([
        launch_ros.actions.Node(
            package="examples_rclcpp_minimal_service",
            node_executable="service_main",
            node_name="service_main",
            node_namespace="",
            output="screen",
            parameters=[]
        ),
        launch_ros.actions.Node(
            package="examples_rclcpp_minimal_client",
            node_executable="client_main",
            node_name="client_main",
            node_namespace="",
            output="screen",
            parameters=[]
        )
    ])

Then i ran this script again and again. Most of the time, things are right. But, i also noticed that sometimes client and service would just hang there forever and sometimes after service has responded, client don't react. The output is listed below:

both hang:

[INFO] [launch]: process[service_main-1]: started with pid [76346]
[INFO] [launch]: process[client_main-2]: started with pid [76347]




^C[WARNING] [launch.LaunchService]: user interrupted with ctrl-c (SIGINT)
[INFO] [rclcpp]: signal_handler(signal_value=2)
[INFO] [launch]: process[service_main-1]: process has finished cleanly
[ERROR] [launch]: process[client_main-2] process has died [pid 76347, exit code 1, cmd '/opt/ros/crystal/lib/examples_rclcpp_minimal_client/client_main __node:=client_main __ns:=/'].
[INFO] [rclcpp]: signal_handler(signal_value=2)
[ERROR] [client_main]: service call failed :(

client hangs:

[INFO] [launch]: process[service_main-1]: started with pid [87612]
[INFO] [launch]: process[client_main-2]: started with pid [87613]
[INFO] [service_main]: request: 41 + 1
^C[WARNING] [launch.LaunchService]: user interrupted with ctrl-c (SIGINT)
[INFO] [rclcpp]: signal_handler(signal_value=2)
[ERROR] [client_main]: service call failed :(
[INFO] [launch]: process[service_main-1]: process has finished cleanly
[ERROR] [launch]: process[client_main-2] process has died [pid 87613, exit code 1, cmd '/opt/ros/crystal/lib/examples_rclcpp_minimal_client/client_main __node:=client_main __ns:=/'].
[INFO] [rclcpp]: signal_handler(signal_value=2)

Expected behavior

both client and service works fine every time.

nnmm pushed a commit to ApexAI/rclcpp that referenced this issue Jul 9, 2022
DensoADAS pushed a commit to DensoADAS/rclcpp that referenced this issue Aug 5, 2022
* Remove outdated pluginlib cmake script from rosbag2_storage

Signed-off-by: Emerson Knapp <[email protected]>
@clalancette
Copy link
Contributor

I just tried this out on the latest Rolling, and I can't seem to make the problem happen. We've improved services quite a lot since crystal, so this may just work now.

Given the age of this issue, I'm going to close it out. If you are still having problems with the latest version of ROS 2, please feel free to open a new issue and we can debug it there.

@clalancette clalancette closed this as not planned Won't fix, can't repro, duplicate, stale Jan 19, 2024
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

No branches or pull requests

2 participants