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

Failed to send request: cannot publish data #1207

Closed
rty813 opened this issue Dec 25, 2023 · 5 comments
Closed

Failed to send request: cannot publish data #1207

rty813 opened this issue Dec 25, 2023 · 5 comments
Labels
more-information-needed Further information is required

Comments

@rty813
Copy link

rty813 commented Dec 25, 2023

Bug report

Required Info:

  • Operating System:
    • Ubuntu 16.04
  • Installation type:
    • from source
  • Version or commit hash:
    • Foxy
  • DDS implementation:
    • CycloneDDS
  • Client library (if applicable):
    • rclpy

Steps to reproduce issue

I couldn't find a consistently reproducible path. It has only occurred once so far, where an exception occurred abruptly during the program execution, leading to an unexpected termination.

Expected behavior

no exception

Actual behavior

Exception in thread Thread-26:
Traceback (most recent call last):
  File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/opt/ros/foxy/install/lib/python3.8/site-packages/rclpy/executors.py", line 290, in spin
    self.spin_once()
  File "/opt/ros/foxy/install/lib/python3.8/site-packages/rclpy/executors.py", line 770, in spin_once
    self._spin_once_impl(timeout_sec)
  File "/opt/ros/foxy/install/lib/python3.8/site-packages/rclpy/executors.py", line 767, in _spin_once_impl
    future.result()
  File "/opt/ros/foxy/install/lib/python3.8/site-packages/rclpy/task.py", line 94, in result
    raise self.exception()
  File "/opt/ros/foxy/install/lib/python3.8/site-packages/rclpy/task.py", line 239, in __call__
    self._handler.send(None)
  File "/opt/ros/foxy/install/lib/python3.8/site-packages/rclpy/executors.py", line 429, in handler
    await call_coroutine(entity, arg)
  File "/opt/ros/foxy/install/lib/python3.8/site-packages/rclpy/executors.py", line 384, in _execute_service
    srv.send_response(response, header)
  File "/opt/ros/foxy/install/lib/python3.8/site-packages/rclpy/service.py", line 74, in send_response
    _rclpy.rclpy_send_response(capsule, response, header)
_rclpy.RCLError: Failed to send request: cannot publish data, at /opt/ros/foxy/src/ros2/rmw_cyclonedds/rmw_cyclonedds_cpp/src/rmw_node.cpp:3605, at /opt/ros/foxy/src/ros2/rcl/rcl/src/rcl/service.c:356
@fujitatomoya
Copy link
Collaborator

@rty813 unfortunately Foxy is already End Of Life. could you try to use Humble or later to see if this problem still happens?

note, this could be related to #1136.

@fujitatomoya fujitatomoya added the more-information-needed Further information is required label Dec 26, 2023
@rty813
Copy link
Author

rty813 commented Dec 27, 2023

@fujitatomoya Thanks, I'll test #1136 on foxy.
By the way, how can I simulate a timeout scenario for rcl_send_response?

@rty813
Copy link
Author

rty813 commented Dec 27, 2023

Assuming this is the issue, why is a timeout occurring, how can it be avoided, how to recovery, and is it possible to increase the timeout for CycloneDDS?

Once a timeout occurs, what kind of result will the synchronous calling client receive, or will it remain blocked indefinitely?

@fujitatomoya
Copy link
Collaborator

Assuming this is the issue, why is a timeout occurring

see ros2/ros2#1253 (comment), it is well explained why this could happen.

how can it be avoided

ros2/rmw_fastrtps#704 is to extend the timeout for https://github.com/ros2/rmw_fastrtps. you can see how to set the configuration XML too. Note, again that ros2/rmw_fastrtps#704 is NOT available in foxy. (Foxy is E.O.L)

is it possible to increase the timeout for CycloneDDS?

that i do not know.

Once a timeout occurs, what kind of result will the synchronous calling client receive, or will it remain blocked indefinitely?

if the timeout is not set, it will wait forever. so synchronous calling client is not recommended w/o timeout.
since client does not know what is going on for service server side, i would do

  1. check service is available or waits for the service online.
  2. call async request.
  3. wait for certain timeout. (depends on application)
  4. if timeouts, call remove_pending_request. back to sequence 1.

@fujitatomoya
Copy link
Collaborator

@rty813 as i mentioned before, Foxy is already E.O.L. if we do not have specific requirements to fix the rclpy in mainline, i would like to close this issue for now. if you have any further questions, you can reach out to https://robotics.stackexchange.com/, that is the central QA site.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more-information-needed Further information is required
Projects
None yet
Development

No branches or pull requests

2 participants