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

rosbridge sometimes doesn't shut down cleanly #945

Closed
bmartin427 opened this issue Aug 2, 2024 · 0 comments · Fixed by #946
Closed

rosbridge sometimes doesn't shut down cleanly #945

bmartin427 opened this issue Aug 2, 2024 · 0 comments · Fixed by #946
Labels

Comments

@bmartin427
Copy link
Contributor

Description
Sometimes when shutting down, rosbridge can get in an infinite loop spamming console output like this over and over again:

[rosbridge_websocket-127] ERROR:tornado.application:Exception in callback <function main.<locals>.<lambda> at 0x708508230040>
[rosbridge_websocket-127] Traceback (most recent call last):
[rosbridge_websocket-127]   File "/usr/lib/python3/dist-packages/tornado/ioloop.py", line 905, in _run
[rosbridge_websocket-127]     return self.callback()
[rosbridge_websocket-127]   File "/home/bmartin/colcon_ws/install/rosbridge_server/lib/rosbridge_server/rosbridge_websocket", line 336, in <lambda>
[rosbridge_websocket-127]     spin_callback = PeriodicCallback(lambda: executor.spin_once(timeout_sec=0.01), 1)
[rosbridge_websocket-127]   File "/opt/ros/iron/lib/python3.10/site-packages/rclpy/executors.py", line 787, in spin_once
[rosbridge_websocket-127]     self._spin_once_impl(timeout_sec)
[rosbridge_websocket-127]   File "/opt/ros/iron/lib/python3.10/site-packages/rclpy/executors.py", line 776, in _spin_once_impl
[rosbridge_websocket-127]     handler, entity, node = self.wait_for_ready_callbacks(timeout_sec=timeout_sec)
[rosbridge_websocket-127]   File "/opt/ros/iron/lib/python3.10/site-packages/rclpy/executors.py", line 762, in wait_for_ready_callbacks
[rosbridge_websocket-127]     return next(self._cb_iter)
[rosbridge_websocket-127]   File "/opt/ros/iron/lib/python3.10/site-packages/rclpy/executors.py", line 539, in _wait_for_ready_callbacks
[rosbridge_websocket-127]     timeout_timer = Timer(None, None, timeout_nsec, self._clock, context=self._context)
[rosbridge_websocket-127]   File "/opt/ros/iron/lib/python3.10/site-packages/rclpy/timer.py", line 28, in __init__
[rosbridge_websocket-127]     self.__timer = _rclpy.Timer(
[rosbridge_websocket-127] rclpy._rclpy_pybind11.RCLError: failed to create timer: the given context is not valid, either rcl_init() was not called or rcl_shutdown() was called., at ./src/rcl/guard_condition.c:67

I think the Tornado I/O loop should be shutdown if the rclpy context is ever 'not ok' to avoid continued attempts to use a bad context.

  • Library Version: 1.3.2-1jammy.20240712.000253
  • ROS Version: iron
  • Platform / OS: Ubuntu 22.04

Steps To Reproduce
I don't have clear steps to consistent reproduction. I just know that interrupting a rosbridge_websocket node that's actively in communication with a client can sometimes result in the above described loop.

Expected Behavior
rosbridge_websocket node shuts down cleanly

Actual Behavior
Occasional infinite loop and console complaints as described above

@bmartin427 bmartin427 added the bug label Aug 2, 2024
bmartin427 pushed a commit to bmartin427/rosbridge_suite that referenced this issue Aug 2, 2024
…bTools#945)

Signed-off-by: Brad Martin <brad.martin@merlinlabs.com>
sea-bass pushed a commit that referenced this issue Aug 15, 2024
…946)

Signed-off-by: Brad Martin <brad.martin@merlinlabs.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants