Skip to content

Conversation

@mergify
Copy link
Contributor

@mergify mergify bot commented Sep 14, 2025

Part of #1399 and #1469.
To allow an executor to reschedule a task when a future stops blocking, it is crucial that the future is attached to the same executor.
Currently, users are able to initialize a Future instance without supplying the executor parameter.
This behavior is necessary to allow calling client.call_async() before attaching the node to an executor (the future is attached to the running executor when processing the service response).

In asyncio, loop.create_future() was added to discourage users from initializing the Future class directly.
I suggest we follow the same path.


This is an automatic backport of pull request #1495 done by Mergify.

* feature: add create_future and test

Signed-off-by: Nadav Elkabets <[email protected]>

* Use create_future in all executor tests

Signed-off-by: Nadav Elkabets <[email protected]>

---------

Signed-off-by: Nadav Elkabets <[email protected]>
(cherry picked from commit bcdd663)
@fujitatomoya
Copy link
Collaborator

Pulls: #1499
Gist: https://gist.githubusercontent.com/fujitatomoya/8f8054c7f44978afeaa71abcd2524065/raw/c660c0112d938503150ac007340c652a9577fb79/ros2.repos
BUILD args: --packages-above-and-dependencies rclpy
TEST args: --packages-above rclpy
ROS Distro: kilted
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/16948

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

@fujitatomoya fujitatomoya merged commit 572a297 into kilted Sep 15, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants