Skip to content

Conversation

@mergify
Copy link
Contributor

@mergify mergify bot commented Dec 3, 2025

Description

Fixes #1467
Fixes #1405
Fixes #1462

Is this user-facing behavior change?

  • The _pending() method in Future has been renamed to pending()
  • The user no longer has to do any workarounds with waking up the executor when a coroutine gets stuck awaiting a future that is already finished.

Did you use Generative AI?

Some of the comments and docstrings might be partially written by Github Copilot.

Additional Information

For #1467, I propagate a guard condition from a task to the awaited future and add this guard condition to the wait set in the executor. When a future is completed by an entity not controller by the executor (e.g. a separate thread), the guard condition is triggered and wakes up the executor so it can resume the task.

For #1405, I just had to make sure the task is not yielded from _wait_for_ready_callbacks when it is not ready to be resumed, hence the Task.ready() method.

EDIT: Check this comment


This is an automatic backport of pull request #1469 done by [Mergify](https://mergify.com).

Signed-off-by: Błażej Sowa <[email protected]>
Signed-off-by: Nadav Elkabets <[email protected]>
Co-authored-by: Nadav Elkabets <[email protected]>
(cherry picked from commit 9695271)

# Conflicts:
#	rclpy/rclpy/executors.py
#	rclpy/rclpy/task.py
#	rclpy/test/test_executor.py
#	rclpy/test/test_task.py
@mergify mergify bot added the conflicts label Dec 3, 2025
@mergify
Copy link
Contributor Author

mergify bot commented Dec 3, 2025

Cherry-pick of 9695271 has failed:

On branch mergify/bp/jazzy/pr-1469
Your branch is up to date with 'origin/jazzy'.

You are currently cherry-picking commit 9695271.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   rclpy/src/rclpy/events_executor/events_executor.cpp
	modified:   rclpy/src/rclpy/events_executor/events_executor.hpp

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   rclpy/rclpy/executors.py
	both modified:   rclpy/rclpy/task.py
	both modified:   rclpy/test/test_executor.py
	both modified:   rclpy/test/test_task.py

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

Copy link
Contributor

@ahcorde ahcorde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bjsowa can you take a look to the conflicts?

@bjsowa
Copy link
Contributor

bjsowa commented Dec 8, 2025

@bjsowa can you take a look to the conflicts?

I created #1560 with a manual backport

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants