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

[BUG] RuntimeError: deque mutated during iteration #4207

Open
zymouse opened this issue Jan 13, 2025 · 1 comment
Open

[BUG] RuntimeError: deque mutated during iteration #4207

zymouse opened this issue Jan 13, 2025 · 1 comment
Labels
question Further information is requested

Comments

@zymouse
Copy link

zymouse commented Jan 13, 2025

Description

Error in ros2 subscriber callback function modifying value of ui object

[robobus3_gui-1] Exception in thread Thread-1 (ros_main):
[robobus3_gui-1] Traceback (most recent call last):
[robobus3_gui-1]   File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
[robobus3_gui-1]     self.run()
[robobus3_gui-1]   File "/usr/lib/python3.10/threading.py", line 953, in run
[robobus3_gui-1]     self._target(*self._args, **self._kwargs)
[robobus3_gui-1]   File "/home/nvidia/pix/robobus/autoware-robobus/install/autoware_simplicity_gui/lib/python3.10/site-packages/autoware_simplicity_gui/robobus3_gui.py", line 775, in ros_main
[robobus3_gui-1]     rclpy.spin(node)
[robobus3_gui-1]   File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/__init__.py", line 222, in spin
[robobus3_gui-1]     executor.spin_once()
[robobus3_gui-1]   File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 739, in spin_once
[robobus3_gui-1]     self._spin_once_impl(timeout_sec)
[robobus3_gui-1]   File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 736, in _spin_once_impl
[robobus3_gui-1]     raise handler.exception()
[robobus3_gui-1]   File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/task.py", line 239, in __call__
[robobus3_gui-1]     self._handler.send(None)
[robobus3_gui-1]   File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 437, in handler
[robobus3_gui-1]     await call_coroutine(entity, arg)
[robobus3_gui-1]   File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 362, in _execute_subscription
[robobus3_gui-1]     await await_or_execute(sub.callback, msg)
[robobus3_gui-1]   File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 107, in await_or_execute
[robobus3_gui-1]     return callback(*args)
[robobus3_gui-1]   File "/home/nvidia/pix/robobus/autoware-robobus/install/autoware_simplicity_gui/lib/python3.10/site-packages/autoware_simplicity_gui/robobus3_gui.py", line 156, in onOrin2Header
[robobus3_gui-1]     self.label_orin2.text = f"{msg.frame_id}: {msg.stamp.sec}"
[robobus3_gui-1]   File "/home/nvidia/.local/lib/python3.10/site-packages/nicegui/binding.py", line 155, in __set__
[robobus3_gui-1]     self._change_handler(owner, value)
[robobus3_gui-1]   File "/home/nvidia/.local/lib/python3.10/site-packages/nicegui/elements/mixins/text_element.py", line 11, in <lambda>
[robobus3_gui-1]     on_change=lambda sender, text: cast(Self, sender)._handle_text_change(text))  # pylint: disable=protected-access
[robobus3_gui-1]   File "/home/nvidia/.local/lib/python3.10/site-packages/nicegui/elements/mixins/text_element.py", line 85, in _handle_text_change
[robobus3_gui-1]     self.update()
[robobus3_gui-1]   File "/home/nvidia/.local/lib/python3.10/site-packages/nicegui/element.py", line 388, in update
[robobus3_gui-1]     self.client.outbox.enqueue_update(self)
[robobus3_gui-1]   File "/home/nvidia/.local/lib/python3.10/site-packages/nicegui/outbox.py", line 41, in enqueue_update
[robobus3_gui-1]     self._set_enqueue_event()
[robobus3_gui-1]   File "/home/nvidia/.local/lib/python3.10/site-packages/nicegui/outbox.py", line 35, in _set_enqueue_event
[robobus3_gui-1]     self._enqueue_event.set()
[robobus3_gui-1]   File "/usr/lib/python3.10/asyncio/locks.py", line 191, in set
[robobus3_gui-1]     for fut in self._waiters:
[robobus3_gui-1] RuntimeError: deque mutated during iteration
@falkoschindler
Copy link
Contributor

@zymouse Please describe how to reproduce this error. Can you share a minimal reproducible example? Does it help to upgrade to the latest NiceGUI 2.9.1?

@falkoschindler falkoschindler added the question Further information is requested label Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants