Skip to content

Remove sync requirement for action server task - #670

Open
mxgrey wants to merge 1 commit into
ros2-rust:mainfrom
mxgrey:non_sync_action
Open

Remove sync requirement for action server task#670
mxgrey wants to merge 1 commit into
ros2-rust:mainfrom
mxgrey:non_sync_action

Conversation

@mxgrey

@mxgrey mxgrey commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator

This is a teeny tiny PR that removes an unnecessary restriction on action servers.

When I initially implemented the action server API, I naively put both Send + Sync requirements everywhere to ensure that objects can be used safely across threads. This is more restrictive than necessary for the async task that needs to be produced by an action server. Async tasks really only need to be Send, not Sync. It's worth noting that BoxFuture, which gets used to encapsulate many async tasks across many different Rust async execution engines, only requires Send and not Sync.

This change is backwards compatible for all existing uses of this API, because we are only removing a constraint.

Signed-off-by: Michael X. Grey <mxgrey@intrinsic.ai>
@azerupi

azerupi commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

There are a few more places with the same where clause

where Task: Future<Output = TerminatedGoal> + Send + Sync + 'static

Should we change all of them?

  • drain_receiver_into_callback
  • set_callback
  • into_action_server in rclrs/src/action/action_goal_receiver.rs

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