Bugfix: executor doesn't propagate exception from task that awaited a future (backport #1643) - #1653
Conversation
… future (#1643) * Schedule the original task when task awaits a future Signed-off-by: Nadav Elkabets <elnadav12@gmail.com> * Add MultiThreadedExecutor to test Signed-off-by: Nadav Elkabets <elnadav12@gmail.com> * Add tests for awaiting a done future and task cancellation during await Signed-off-by: Nadav Elkabets <elnadav12@gmail.com> * Removed unused variable Signed-off-by: Nadav Elkabets <elnadav12@gmail.com> --------- Signed-off-by: Nadav Elkabets <elnadav12@gmail.com> (cherry picked from commit aac0ebb) # Conflicts: # rclpy/rclpy/task.py # rclpy/test/test_executor.py
|
Cherry-pick of aac0ebb has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
|
Tick the box to add this pull request to the merge queue (same as
|
|
Pulls: #1653 |
Signed-off-by: Alejandro Hernandez Cordero <ahcorde@gmail.com>
|
ros2/ci#885 has been merged, so please re-run CI. |
|
@ahcorde @mjcarroll |
|
Pulls: #1653 |
done! |
ahcorde
left a comment
There was a problem hiding this comment.
can yuo check the failures @nadavelkabets ?
|
Tick the box to add this pull request to the merge queue (same as
|
I don't have push permissions to this branch so I created a PR #1713 |
Signed-off-by: Nadav Elkabets <elnadav12@gmail.com>
|
Tick the box to add this pull request to the merge queue (same as
|
Fixes #1642
Changes
A task now registers itself on the awaited future via new
Future._add_waiting_task.The executor then dispatches the same
Taskobject and sees its exception throughhandler.exception()as intended.Future._callbacksnow holdsUnion[Callable, Task]_schedule_or_invoke_done_callbackshandlesTaskentries throughexecutor._call_task_in_next_spin._wait_for_ready_callbacksskips tasks that were cancelled or completed between being queued and being popped.warnings.warnfires if a waitingTaskis dropped because the executor weakref could not be resolved.This is an automatic backport of pull request Bugfix: executor doesn't propagate exception from task that awaited a future #1643 done by Mergify.