You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
connections.pybricks: fix leaking tasks if race_disconnect() is canceled
If the `race_disconnect()` method is canceled while waiting for either
of the tasks, there is nothing that ever awaits the tasks, so we get
errors like:
2025-09-09 21:22:25,946: ERROR: asyncio: Task was destroyed but it is pending!
task: <Task pending name='race_disconnect: Queue.get' coro=<Queue.get() done, defined at python\3.13.0\Lib\asyncio\queues.py:172> wait_for=<Future cancelled>>
2025-09-09 21:22:25,947: ERROR: asyncio: Task was destroyed but it is pending!
task: <Task pending name='Task-21' coro=<Event.wait() done, defined at python\3.13.0\Lib\asyncio\locks.py:200> wait_for=<Future pending cb=[Task.task_wakeup()]>>
To avoid this, cancel the tasks if anything goes wrong while waiting.
0 commit comments