Skip to content

Conversation

@alsora
Copy link
Collaborator

@alsora alsora commented May 17, 2025

Description

The spin_until_future_complete can lead to unexpected behaviors.
It will only check if the future is complete when the timeout expires or after executing an executor's entity.

This will work as expected only if there's an event waking up the executor when the future becomes ready.
For example this will happen when doing a ROS client request and receiving a future.

auto future = client.async_send_request(request);
executor.spin_until_future_complete(future);

But it will not work correctly for any other generic future

auto future = my_non_ros_stuff();
executor.spin_until_future_complete(future);

In particular we may end up spinning for a lot more after the future is complete.

Is this user-facing behavior change?

No, just adding a comment

Did you use Generative AI?

No

Additional Information

This same problem is discussed as part of #2475

alsora added 2 commits August 23, 2025 11:36
…ly with futures generated by ROS entities

Signed-off-by: Alberto Soragna <[email protected]>
@alsora alsora force-pushed the asoragna/add-disclaimer-spin-future-complete branch from 46ed15b to 529b616 Compare August 23, 2025 09:38
@alsora
Copy link
Collaborator Author

alsora commented Aug 26, 2025

Test failures are unrelated.
merging this doc-only change

@alsora alsora merged commit 3644195 into rolling Aug 26, 2025
2 of 3 checks passed
@alsora alsora deleted the asoragna/add-disclaimer-spin-future-complete branch August 26, 2025 12:36
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.

4 participants